Not really sure what kind of updates are being applied to PCT, but the latest version is absolutely unusable. There's an extreme memory leak, the app just gobbles RAM during playback until it crawls to a halt.
It seems versions are not being tested before being released, perhaps that's something that can be addressed? I can help with testing and/or debugging.
Operating System Version:
Windows 10
Popcorn Time Version:
0.4.4.0
Download date:
18/04/2020
Normal, responsive behaviour
The app is using 5GB of RAM after watching 20 minutes of a movie and becomes completely unresponsive. Pausing takes seconds to actually take place and, at one point, playback just begins to stop altogether.
Just watch anything. Tested with Avengers Endgame (1080p) and Star Wars Rise of Skywalker.
Check in advanced settings...
What is the value of "Connection Limit" ?
Is "Continue seeding torrents after restart app ?" checked ?
What is the value of "Maximum number of active torrents" ?
Thx
Here you go:

Let me know if you need anything else :)
Can you try reinstalling? Just watched 40 minutes of the Avengers Endgame in 1080p, whilst RAM usage only once spiked above 1GB.
I have almost exactly the same, I tried reinstalling fresh multiple times and I have recorded a 15 minute video showing the escalation of ram usage, please fix it because otherwise it is a very good application
https://www.youtube.com/watch?v=1-gdIca9ycM
Thanks in advance Team
@artikweb thx, I was thinking it could be related to keep seeding feature, but your settings show it isn't.
@Persei08 Is there anything I can provide to help troubleshoot this bug? Logs? Screenshots? Let me know and I'll get them for you.
I'm not sure. Run PT from terminal with --remote-debugging-port=9222 arguments.
Connect to localhost:9222 so you will be able to check console logs here for both main and background page process.
Reproduce the issue, check teminal output and both console logs. Share them here (eventually mask your ip, username too)
I managed to get my memory leaking, couldn't manage to reproduce it yesterday.
When the memory leak started to happen, the JSArrayBufferData was expanding exponentially.
I took various heap snapshots and this is what I found:
Before the memory leak was happening, the ArrayBuffer was about 12 mb. But when the memory leak happend it expanded to 140 mb in mere seconds:

Leakage is happening in the Torrent (from the node module WebTorrent), specifically here:
Before memory leak:

After/During:

So I've tried to update the WebTorrent module to the latest version didn't seem to make a difference (they stopped updating their changelog on their GitHub and can't find any references to a memory leak). So I guess it has to be in our implementation of the WebTorrent.
My knowledge with memory leak is quite low, so I'd like to share this hoping someone will realize what's going on.
This is out of my knowledges.
Try reduce Connection Number on settings
Similar issues #1299
Did some more digging, found out what's causing it. Atleast I think...

Each of these InternalNodes/V8IdleRequestCallbacks are created (according to the allocation stack) by webtorrent's torrent.js. In this module there is a update function which looks like this:

From what I've been able to gather, this is what's leaking memory. These V8IdleRequestCallbacks never get garbage collected and just keep chilling. I'd say webtorrent should've found this by now if the issue was on their side. However since there hasn't been a single mention of a memory leak (that I could find) on PT version or better, I'm starting to believe that it's the implementation of WebTorrent in PopcornTime.
Is there anyone, with more experience dealing with either PopcornTime's webtorrent or with memory leaks that's able to fix this? Kinda a big issue...
Or should we take it up to webtorrent, that it might be a problem on their side?
Edit 27th April:
As of now I've been able to confirm that's a problem regarding webtorrent. Downgrading (using the package.json) to 0.102.4 solves the memory leak. I'd like to hear from @team-pct what their thought on this issue is? As far as I know, we could even push a temporary fix, which just downgrades webtorrent to 0.102.4 as I haven't been able to find anything broken. If someone else could verify this, that'd be great!
I will be using 0.3.10-0 with new api patch untill fixed
It's getting on my nerves as well, haven't been able to get it to leak again using the latest patch, but then again, I wasn't able to do that at first either.
I'd (and I think many others) really appreciate a response from @team-pct regarding this issue, as it's really big issue. I've done a lot of research and testing with this and as far as I'm concerned it's still due to the WebTorrent library.
This affects me too - I watch one movie, and popcorn's process has eaten 11GB of ram.
I have to keep killing it to keep the rest of my desktop responsive.
I'm currently on 5eb53fc0ef1, running on Gentoo Linux
https://ci.popcorntime.app/job/Popcorn-Time-Desktop/424/
memory leaks when i start update seeding
I know its been a long time but there was no change on this so maybe its time for a *bump.
@KingOrdinaryCitizen so its confirmed? its the new webtorrent module? What's the latest version you can use that doesnt have the memory leak? Nothing newer than 0.102.4?
Does anyone still have this issue with the latest dev build? (451 at the moment of writing this)
I tried a5025d1 last night for a few hours and I did not encounter this issue - so bug can remain closed for now.
Can confirm, as of the latest build available (#452) the memory leak is no longer happening.
I think it'd be a good idea to release a hotfix asap.