Node Webkit 0.20.3 memory leak on windows 10/8
Our application was updated from nw version v0.12.3 to v0.20.3. There seems to be a memory leakage when the application works in the background for about several days. Unfortunately this is a bit difficult to reproduce (not all windows computers produce the leakage), but the ones that do - make the ram consumption go up above 2gb until it crashes.
We tried to invoke the garbage collection manually, by exposing it and running it every hour, but it didn't help.
No memory leakage was detected when using v0.12.3.
The app basically uses webrtc, and websockets to communicate with a server and stream audio and video.
Older source code can be found here
Any ideas on how to fix it?
Does the memory leak occur when there is no app? I'm facing a similar issue but mitigate it somewhat with changing my app code. But yes I think I can see a similar issue.
With 0.21.3 I see sometimes that app hangs for about 5-7s. Actually, the whole system hangs. And this happens only when app in foreground. I will try to grab some logs next time I will get that. Also, a lot of our users report huge performance degradation with the new build, which is based on 0.21.* For me it feels more like upstream issue, but it needs some deeper investigation.
It's better to check the JS heap first with devtools to make sure there is no leak in the application code.
@mscreenie I'm not sure what you mean by no app. The problem for us is that when the application is launched and hidden in system tray, and remains so for a couple of days, on some computers it consumes huge ammounts of ram.
@rogerwang I can't reproduce the scenario on my computer, we'll need to build a version with devtools and ask our clients that encountered the issue to provide us with heap snapshot. I'll get back to you when we have something. Note that no users reported issues with memory leaks on v0.12.3, and only minor changes were made to the application when porting it to v0.20.3, therefore we don't think that it's a problem with the code
We changed architecture in 0.13, so lots of internal things are different. It's hard to tell when compared with a 0.12 a
Is this issue still reproduced on the latest nwjs build?
We managed to pinpoint the memory leak to be a part of the script which was constantly checking if a certain server was reachable in browser context. However when exactly the same script was placed inside node context it was no longer leaking, which was odd.
close this, please reopen if you meet this issue again.