Open beljand opened 7 years ago
Seeing this as well in an app I've been working on, got up to 37 processes with the app running over the course of the week, when they are running they look like the below when using electron-process-manager. They seem to be instances of cld2.js
via electron-remote/renderer-require-preload.html
that are not stopping or getting hung up.
After some more experimenting it seems to happen if the calling renderer closes before the process completes it gets stuck.
I'm not proud of it (kind of a dirty hack and may cause issues on slow machines)... but I do have a work around for this issue that seems to work. Basically it watches in the main process for windows to be created, then waits for them to load. If when they load the url is the preloader and loading cld2.js a timer is started at double the default idle timeout (5s). If the window is still open when the timeout expires it closes it.
app.on('browser-window-created', function(e, window) {
var timeout;
window.webContents.once('did-finish-load', function() {
var url=decodeURIComponent(window.webContents.getURL());
if(url.indexOf('electron-remote/lib/renderer-require-preload.html')>0 && url.indexOf('electron-spellchecker'+path.sep+'lib'+path.sep+'cld2.js')>0) {
timeout=setTimeout(function() {
if(window && !window.isDestroyed()) {
window.close();
}
}, 10000)
}
});
window.once('closed', function() {
clearTimeout(timeout);
});
});
You can add this line at the top of the issue description, it will update itself
![badge](https://api.bountysource.com/badge/issue?issue_id=47889325)
and it looks like
We're using the default implementation of electron-spellcheker (by the book - docs) and saw that every time a word gets processed a new system process is created and it is not cleared. Those processes stay alive until the app gets shut down.