Anarios / return-youtube-dislike

Chrome extension to return youtube dislikes
https://returnyoutubedislike.com/
GNU General Public License v3.0
12.7k stars 567 forks source link

(Bug): Random memory leaks #166

Open jericjan opened 2 years ago

jericjan commented 2 years ago

Browser

Google Chrome

Browser Version

Version 96.0.4664.45

Extension or Userscript?

Extension

Extension/Userscript Version

1.0.0.2

What happened?

It seems to be completely random but I know that it's from this extension because when the memory leak happens, my PC gets super slow and when I disable the extension, it instantly goes back to running normally. I can't provide a video link because as I said, it's completely random. Iirc, I've mostly seen it happen when I'm not focused in a YT tab but that could be completely unrelated.

PickleNik commented 2 years ago
Screen Shot 2021-12-04 at 4 02 41 PM Screen Shot 2021-12-04 at 4 02 02 PM

Been trying to reproduce, so far no luck.

Frontesque commented 2 years ago

I can't seem the reproduce this either. Could you show us the Chrome Task Manager to show high memory usage?

jericjan commented 2 years ago

Finally saw it happen. Still random though. 01 02 It just shows me that the Browser itself is all of a sudden using a ton of CPU. And when I disabled and re-enabled the extension, it immediately dropped as seen in the second image.

jericjan commented 2 years ago

I think I have a theory for why this happens and why yall can't reproduce it. It might not even be a memory leak.

I open lots of YouTube tabs, probably in the hundreds. While I'm opening them one by one, the extension doesn't use up all of my CPU. It seems to happen when the hundreds of tabs have been "discarded" by Chrome from inactivity and I come back to the window and it's as if every single tab is being worked on at once by the extension.

Just today, Chrome's Task Manager told me that the Browser used up 700% of my CPU, which doesn't even make sense because I only have 2 cores.

I disabled the extension again and well, the usage dropped like I expected.

I'm still not 100% sure this is the real cause but I think an update where it doesn't work on unfocused tabs would be the fix for it perhaps.

Frontesque commented 2 years ago

I open lots of YouTube tabs, probably in the hundreds. While I'm opening them one by one, the extension doesn't use up all of my CPU. It seems to happen when the hundreds of tabs have been "discarded" by Chrome from inactivity and I come back to the window and it's as if every single tab is being worked on at once by the extension.

That's a good theory and I'll have to do some testing on that. Based on the way that chrome extensions work, that might actually be possible.

Just today, Chrome's Task Manager told me that the Browser used up 700% of my CPU, which doesn't even make sense because I only have 2 cores.

As for the 700% thing... I know that chrome may display up to "200%" if you have a hyperthreaded processor (eg 2 cores 4 threads) but I've never heard of 700%.

jericjan commented 2 years ago

I encountered it again today. I tried closing the tabs themselves, but it still used up around the 100% range of my CPU. No tabs open whatsoever. Restarted the extension and back to normal again.

Anarios commented 2 years ago

I encountered it again today. I tried closing the tabs themselves, but it still used up around the 100% range of my CPU. No tabs open whatsoever. Restarted the extension and back to normal again.

thanks for report

Karlos-Fandango commented 2 years ago

Also getting hit about once a week with high CPU, toggling off/on the extensions clears it I usually have two chrome windows with a large number of tabs open (40+), including several youtube videos, generally a few paused. I tend to see it when coming back to my laptop after 30 mins plus and unlocking. Not seen it after a start from hibernate. I enabled the "collect errors" option in the extension manager. Happy to run more debug if requested