-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
processes remaining open and leaking memory after killing main process #7852
Comments
happening to me as well kind of frequently, i also spawn processes & use stdin, stderr, etc .. but also happens without those things involved - currently investigating if related to media streams open, event handlers between main & renderer or objects shared between renderers ... i am clueless really but would be glad to help to find the issue. Also wondering if a workaround would be possible, so after the application exits a script kills the helper processes if they stay alive. |
We has same issue, crash or running some process after "close" app. |
long discutions and theory over there |
no solution, though. @rogerwang can you let us know what's needed to get this behavior fixed? |
the only solution i use is |
Unfortunately, that is not a solution. It's an ugly workaround that doesn't work in many cases. That also kills valid |
my application creates a socket server on the main process which renderers then connect to - funny thing is, if there has been a previous dirty exit with hung renderers, if you reopen the application, the new instance´s renderers connect to the older instance socket server, in the main thread that should not exist - so it also stays alive in my case and apparently responsive - however I cannot connect a debugger to it or its former renderers - the debugger does not connect. |
Fixes: #70 Refs: nwjs/nw.js#7852
Does this happen if you call the child_process.unref function? proc.on('exit', () => {
quit = true;
});
+ proc.unref() Alternatively this can be reproduced by installing the nw package and running npm start. {
"scripts": {
"start": "nw --unref ."
}
} |
NWJS Version : 0.62.0
Operating System : Windows 10
Expected behavior
When the main
nw.exe
process is killed, all child processes should also be killed. Nonw.exe
processes should continue leaking memory until the system crashes.Actual behavior
Intermittently, 2-3
nw.exe
processes will remain running after the "main" process is terminated. When this happens, those processes will continue increasing memory usage until the system runs out of memory and begins killing active processes.How to reproduce
node test.js
nw.exe
processes will remain running.nw.exe
processes slowly chew through all available system memory.package.json
bug.html
test.js
The text was updated successfully, but these errors were encountered: