popcorn-official / popcorn-desktop

Popcorn Time is a multi-platform, free software BitTorrent client that includes an integrated media player ( Windows / Mac / Linux ) A Butter-Project Fork
https://popcorn-time.site
Other
9.45k stars 625 forks source link

Extreme RAM usage and unresponsive #1373

Closed artikweb closed 11 months ago

artikweb commented 4 years ago

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

Expected Behaviour

Normal, responsive behaviour

Actual 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.

Steps to reproduce the behaviour

Just watch anything. Tested with Avengers Endgame (1080p) and Star Wars Rise of Skywalker.

merseyV commented 11 months ago

@kiriles90

Epilogue.

Tried a random mix of older popular torrents: 2 movies, 3 shows consecutively. Memory isn't returned until app is closed (that's just how it is, I think?).

In order of: file size .... memory .... cpu ..... peers ..... speed MB/s

Looks ok to me? 1st includes standing memory for opening the app, otherwise it's 300-400MB per torrent (roughly). 5th torrent looks odd - like it only used 100MB? That might be M1 Silicon memory management (guessing) ... noticed compressed memory had risen by about 550MB from 3rd to 5th torrent. Looked (reasonably) stable after last download completed.

Something different about fresh torrents with large file sizes, which is beyond my pay-grade! Apart from being a bit profligate with my precious 8GB of (expensive) memory - Popcorntime seems to be back on the rails ( fingers-crossed! :)

kiriles90 commented 11 months ago

@merseyV are they still active in the Seedbox? (you've got 5 active torrents as a limit still I guess?) What happens when you remove them? (I don't think their cache needs to be deleted but you could try that one as well) ~400MB is basically normal usage / torrent. But only if its being cleared once that torrent is removed. If not.. its a leak.

merseyV commented 11 months ago

@kiriles90

are they still active in the Seedbox? (you've got 5 active torrents as a limit still I guess?)

Seedbed is off .... no active torrent option.

What happens when you remove them?

Nothing - this isn't the downloading feature ... it's 'Watch Now". Torrent is closed and next one is started ('Watch Now') Just like someone binge watching (About 8hrs in this case).

But only if it's being cleared once that torrent is removed.

No, that's the thing it doesn't clear till the app closes. Before your fix - you can imagine a user with minimum memory (like me) having the "gross leak" while binge watching a few new movies or episodes. He's probably straight onto the subreddit saying "I've just watched two episodes (no problems) but the third one keeps stuttering and then freezes .... Sound familiar?

I've gone all the way back to 0.3.8-5 (same) but in that version it's a very small increase. Webtorrent mentions it, but it all kinda gets lost because they had more than one memory/cpu issue - over many years. It's not the runaway memory usage I gave examples of ... more like not emptying the trash (garbage) and releasing the 3/400 MB of memory? There's no leak after each movie/show has finished - next watched torrent just adds to the previous total? I got the impression some of the memory was being overwritten/moved because the current total wasn't moving as fast as I expected - when new downloads (4+5) were started?

qBittorrent does the same (holds memory) but it's minuscule by comparison.

Nevertheless, if I can watch 8hrs worth of stuff and memory usage is under 2.0 GB - you'd never know there was an issue? Silicon has an unusual (so I read) memory management regime. And I've got Rosetta 2 on top (it's all beyond my ken!!). I've seen Mac users (with more ram than me) complaining. I couldn't follow the thread ... but the gist of it was: M1 Macs allocates all memory resources as it sees fit. The more it gets the more it allocates (lol). Don't ask ... I just switch it on!

Think I'll keep that kidney, after all? :D