RomainLK / ytc-filter

Web extension for when Youtube chat is too fast
MIT License
56 stars 15 forks source link

High CPU and Memory usage after update(?) #61

Closed Lucky2307 closed 3 years ago

Lucky2307 commented 3 years ago

Untitled-1

As you can see from the screenshot above, CPU maxed out and Memory kept climbing indefinitely. Started happening a few hours ago which I suspect when the latest update rolled out. Stopped happening after I disabled the extension.

Windows 10 Version 2004 Build 19041.746 Microsoft Edge Version 87.0.664.75 (Official build) (64-bit) ytcFilter Version 2.1.2

RomainLK commented 3 years ago

Hm I haven't tested with Edge. For now, how often do you use ytcFilter? Ideally I would need you to access the popout to see the size of your archive.

When did the CPU usage peak? Right when starting a video after the update or later?

In any case, I suggest if possible, to Popout > Help > Full Reset. Otherwise, uninstall, close your browser then reinstall.

edit: also, when it started to happen, how many livechat did you have at the same time?

Lucky2307 commented 3 years ago

Seems like doing the full reset fixed it.

To answer your questions:

RomainLK commented 3 years ago

Ok, you have one of this very rare case that I can't easily identify. Chance are you had huge archive which needed to migrate. Though I already tried with an archive of 130 videos in Firefox, and it tooks a few seconds and 450mb of RAM to migrate, then have it go down to 76mb when it's done. Still nothing like you described.

I will keep the issue open for now in case someone else encounter the issue during the update. As for a fix, just in case but I will overhaul the migration system in 3.0.0 to bypass a number of things which may increase CPU/RAM usage.

RomainLK commented 3 years ago

I have received some archive which lead me to think that the problem is due to how many stream people have seen, not necessarily the size of the archive or the number of messages saved. I should have a fix for 2.1.3, but by the time it will be out, chance are everyone already migrated as it takes around 2 days for Chrome user to update ( Google reviews are longer... ) and Firefox is almost done already.

If someone encounter the issue, reinstall the extension or full reset. Good thing is 2.1 introduces autocleaning to avoid having these kind of issue in the future.

DDDespair commented 3 years ago

Having the same issue. Huge CPU/RAM spikes in Chromium the moment I click on a livestream. The Popout/Settings button wouldn't work at all, so I'll try a reinstall.

Edit: Reinstall cleared it up. Everything working great. Double Edit: Spoke too soon. The RAM/CPU problem has been fixed, but after the initial setup the Popout/Settings button doesn't work correctly for me. The popout window opens as it should, but clicking the show settings option in it does nothing now. Light/Dark works however.

RomainLK commented 3 years ago

I have a fix for migration in 2.1.3, not sure if it will be useful considering migration for everyone should be done by now. I will close the issue when it's released on Chrome web store

@DDDespair If you open the console of the popout, do you have any error message before or after pressing the "Show settings" button?

DDDespair commented 3 years ago

No. On pressing "Popout/Settings" I get a full size window https://i.imgur.com/SjXbq9G.jpg When I hit "Show Settings" it resizes to https://i.imgur.com/Iw7gNh1.jpg but displays nothing else. The chat messages do show up on the popout window, it just has my global default of staff/mod messages applied. I'm just not sure why the initial had the settings button work but it doesn't now.

RomainLK commented 3 years ago

By console, I meant opening the debugger with F12 when the focus is inside the popout, then accessing the console tab of the debugger. Error message would appear there. Last time I had such issue, it's again the storage being corrupted, so for end user, aside of reinstalling, after closing the browser there is not much you can do without dwelving deeper.

If you can, it would help me debug if you can extract the content of your storage. In order to do so, in the console of the popout, you paste the following code at the bottom of the console. chrome.storage.local.get(s => console.log(JSON.stringify(s)))

DDDespair commented 3 years ago

Ah, I see. Console shows this

 popout-main.js:7 TypeError: Cannot read property 'default' of undefined
     at channelArchive (popout-main.js:21)
     at r.forEachGetter.t._wrappedGetters.(chrome-extension://mnldnbhgfocmkehnlkeanlhfmopepnko/anonymous function) (chrome-extension://mnldnbhgfocmkehnlkeanlhfmopepnko/popout-main.js:15:111736)
     at Pn.<anonymous> (popout-main.js:15)
     at hn.get (popout-main.js:7)
     at hn.evaluate (popout-main.js:7)
     at Pn.channelArchive (popout-main.js:7)
     at Object.get [as channelArchive] (popout-main.js:15)
     at a.<anonymous> (popout-main.js:38)
     at a.t._render (popout-main.js:7)
     at a.r (popout-main.js:7)

Here's a link to what the debug command spit out https://litter.catbox.moe/5xpvjh.txt

RomainLK commented 3 years ago

Thanks for your help. I now have an hint of what the issue could be. It needs further investigation for now but I should have some fix for next release. I have opened ticket #69 for your problem and will close this one as it's not linked.

As a workaround, I'm sorry to say this but you will have to retry uninstalling, closing your browser, then reinstalling. So far it seems like you found a very rare bug, and most people have been successful doing so. I hope it won't happen again, or you can post in the other ticket if it does.