4chan-x icon indicating copy to clipboard operation
4chan-x copied to clipboard

Huge Memory leaks / Heavy Cpu usage

Open Vafarien opened this issue 10 years ago • 17 comments

Your code must have an error, because before it didn't used to use so much CPU now it spikes and Uses a ton of Page File. and it becomes one of the most process intensive pages on my system.

Gifs don't happen to load properly because of this, as they seem to skip tons of frames when loaded.

Chrome reports quite a few errors about the page.

Vafarien avatar Mar 04 '14 21:03 Vafarien

Failed to load resource: net::ERR_BLOCKED_BY_CLIENT https://engine.4chan-ads.org/ados.js 15 Uncaught TypeError: Cannot read property 'children' of undefined core-compiled.771.js:11 Uncaught TypeError: Cannot read property 'length' of undefined script.js:6626 3 Uncaught TypeError: Cannot read property 'children' of undefined core-compiled.771.js:11 Uncaught TypeError: Cannot read property 'file' of undefined script.js:7900 30 Uncaught TypeError: Cannot read property 'children' of undefined core-compiled.771.js:11 onParsingDone core-compiled.771.js:11 $.event script.js:622 Fourchan.parseThread script.js:11304 (anonymous function) script.js:9499 $.queueTask.execTask script.js:661 Uncaught TypeError: Cannot read property 'file' of undefined script.js:7900 ImageHover.mouseover script.js:7900 17 Uncaught TypeError: Cannot read property 'children' of undefined core-compiled.771.js:11 onParsingDone core-compiled.771.js:11 $.event script.js:622 Fourchan.parseThread script.js:11304 (anonymous function) script.js:9499 $.queueTask.execTask script.js:661

Vafarien avatar Mar 05 '14 07:03 Vafarien

Chrome? When it's causing an high load? Both Firefox and Chromium idle all the time for me, even when trying to upload a big image.

Spittie avatar Mar 05 '14 18:03 Spittie

Chrome, idling on a page over 150 image posts draw an increased 3-5 cpu page file load. I ask a coder yesterday about whats happening, and he mentions something about an block script that constantly blocking the 4chan ad and causing a ad recheck block loop. which causes a high recheck pagefile.

Vafarien avatar Mar 05 '14 19:03 Vafarien

Oh wow, the chrome window that's running the script, that tab alone is taking up over a GB of memory.

Vafarien avatar Mar 05 '14 19:03 Vafarien

Failed to load resource: net::ERR_BLOCKED_BY_CLIENT https://engine.4chan-ads.org/ados.js Uncaught TypeError: Cannot read property 'children' of undefined core-compiled.771.js:11 Uncaught TypeError: Cannot read property 'file' of undefined script.js:7900 5 Uncaught TypeError: Cannot read property 'children' of undefined core-compiled.771.js:11 Uncaught TypeError: Cannot read property 'length' of undefined script.js:6626

Vafarien avatar Mar 05 '14 19:03 Vafarien

Tampermonkey started VM1208:106 Failed to load resource: net::ERR_BLOCKED_BY_CLIENT https://engine.4chan-ads.org/ados.js Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'id' extension-compiled.771.js:11 QR.cloneCaptcha extension-compiled.771.js:11 QR.onCaptchaReady extension-compiled.771.js:11 onCaptchaReady core-compiled.771.js:18 $._finish_widget recaptcha_ajax.js:172 $.challenge_callback recaptcha_ajax.js:166 Uncaught TypeError: Cannot read property 'length' of undefined script.js:6626 QR.captcha.clear script.js:6626 QR.captcha.load script.js:6654 QR.captcha.afterSetup script.js:6580 Uncaught TypeError: Cannot read property 'children' of undefined core-compiled.771.js:11

Vafarien avatar Mar 05 '14 19:03 Vafarien

http://i.imgur.com/nxgNv1q.png Uploading  . . .

Vafarien avatar Mar 05 '14 19:03 Vafarien

Do you happen to have image prefetching and the replace options enabled? Because that's the only way I can bring it to use more than 150/200mb of ram for a single tab. http://a.pomf.se/tnyrqx.png

Also, this started recently? With what version? Because I never touched code that should case such huge memory leaks.

Spittie avatar Mar 05 '14 19:03 Spittie

@Spittie I don't even have any type of prefetching enabled yet, not even replace.

Vafarien avatar Mar 05 '14 19:03 Vafarien

it started in 1.40

Vafarien avatar Mar 05 '14 19:03 Vafarien

14% cpu usage on a large thread.

Vafarien avatar Mar 05 '14 19:03 Vafarien

I use 1.4.1 4chanX (spitties) tampermonkey (latests version) to run a thread poster list script, but the leak isnt either of those because i disabled both and still had high pagefile&cpu usage.

And the only other script i use is OneeChan 5.0.27 but i've never had issues with oneechan itself before.

Vafarien avatar Mar 05 '14 19:03 Vafarien

Maybe if 4chan changed somethign in their own code that messed up the script a little? It coulda thrown something off with Oneechan im not sure, or possibly something in the 4chanX code.

Something like the new captcha fetch, or like earlier mentioned to do with ad banner block re-fetch loop, causing a high page file re-check ever second. throwing a high page error file. lagging the system over a period of use. possibly creating a large file to be rendered which would take a lot of CPU to run.

Vafarien avatar Mar 05 '14 19:03 Vafarien

Ok, I can reproduce when using Chromium + Tampermonkey. But I can reproduce it even when using an older version too. Any particular reason you're using it? There is a .crx for Chrome. I'm not sure if it's a bug in 4chan X or in Tampermonkey, but since I can't reproduce in Firefox/Chrome, I think it's the latter.

The new captcha shouldn't have anything to do with memory usage, all it need to do is fire a loadRecaptcha event. And I'm not sure what you're referring to with "ad banner block re-fetch loop", since 4chan X doesn't block the ads, and it wouldn't need a loop to block them anyway.

Spittie avatar Mar 05 '14 20:03 Spittie

I don't need tampermonkey for 4chanX, i just use it for a script that lists current posters in a thread. I can reproduce the lag without tampermonkey as well. I did download your crx from your git page.

Vafarien avatar Mar 05 '14 20:03 Vafarien

Restarting the browser and clearing the cache seems to be a temporary fix for now. But in task manager i see it is still using a lot of PF Delta every second

Vafarien avatar Mar 05 '14 20:03 Vafarien

Firefox user here, I have the same problem. Opening a new 4chan page hangs the browser for good 10 minutes. No such problem in Mayhem's version.

raymoo69 avatar Mar 26 '14 20:03 raymoo69