ELIFECYCLE error after repeated `windowManager.getWindows()` usage.
Kyza opened this issue · comments
Bug Description
After calling windowManager.getWindows()
repeatedly over a long period of time, RAM fills up very slowly and causes the application to crash when it reaches the limit.
The application consistently opens with an expected 5% of RAM being used, but then the percentage gradually increases until the application runs out of RAM and crashes. The entire process usually takes about an hour.
Considering the small number of packages that I am directly using, the stack trace I am getting leads me to believe that the problem is either with this package or with how I am using it.
Running with npm start --verbose
.
Condensed To Possible Keywords
unsafe-perm in lifecycle true
CWD: C:\Users\NAME\Documents\GitHub\Webtop
Failed to exec start script
Exit status 3221225477
at EventEmitter.<anonymous> (C:\Users\NAME\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
at EventEmitter.emit (events.js:223:5)
at ChildProcess.<anonymous> (C:\Users\NAME\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
npm verb pkgid Webtop@0.0.1
node v12.14.1
npm v6.13.7
npm timing npm Completed in 3163250ms
¯\_(ツ)_/¯Click to open the full error log.
npm verb lifecycle Webtop@0.0.1~start: unsafe-perm in lifecycle true
npm verb lifecycle Webtop@0.0.1~start: PATH: C:\Users\NAME\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\NAME\Documents\GitHub\Webtop\node_modules\.bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\NAME\AppData\Local\Microsoft\WindowsApps;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Progr;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\lib\mpv.install\tools;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\nodejs\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.4.0\;C:\tools\cuda;C:\Users\NAME\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\NAME\AppData\Local\Programs\Python\Python37\;C:\Users\NAME\Anaconda3\pkgs\openssl-1.1.1d-he774522_2\Library\bin;C:\Users\NAME\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\NAME\AppData\Local\atom\bin;C:\Users\NAME\AppData\Local\Programs\Fiddler;C:\Users\NAME\AppData\Local\Yarn\bin;C:\Users\NAME\AppData\Roaming\npm;C:\Users\NAME\AppData\Local\GitHubDesktop\bin
npm verb lifecycle Webtop@0.0.1~start: CWD: C:\Users\NAME\Documents\GitHub\Webtop
npm info lifecycle Webtop@0.0.1~start: Failed to exec start script
npm verb stack Error: Webtop@0.0.1 start: `electron .`
npm verb stack Exit status 3221225477
npm verb stack at EventEmitter.<anonymous> (C:\Users\NAME\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
npm verb stack at EventEmitter.emit (events.js:223:5)
npm verb stack at ChildProcess.<anonymous> (C:\Users\NAME\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
npm verb stack at ChildProcess.emit (events.js:223:5)
npm verb stack at maybeClose (internal/child_process.js:1021:16)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
npm verb pkgid Webtop@0.0.1
npm verb cwd C:\Users\NAME\Documents\GitHub\Webtop
npm verb Windows_NT 10.0.18362
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\NAME\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start" "--verbose"
npm verb node v12.14.1
npm verb npm v6.13.7
npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! Webtop@0.0.1 start: `electron .`
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the Webtop@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 3221225477, true ]
npm timing npm Completed in 3163250ms
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\NAME\AppData\Roaming\npm-cache\_logs\2020-03-06T21_24_24_445Z-debug.log
To Reproduce
Follow the instructions here to install and run Webtop.
Screenshots
Details
- Operating System: Windows 10 (Windows_NT 10.0.18362)
node-window-manager
version: 2.0.1- Last known working
node-window-manager
version: None
Additional Context
I'm using a very slightly modified version of node-window-manager
located here in my repo that implements the fix for this issue. It is meant to be a temporary fix until the release is published to NPM.
The higher CPU usage is expected. However, I have 32GB of RAM. And only 25% RAM usage of 32GB is 8GB, which is 100% RAM usage on most standard systems. Yeah, very high.
After further digging, the memory leak issue could also be on Electron's end with desktopCapturer
.
Electron could be running out of memory and trying to close gracefully. That would cause my cleanup code to launch a child process and possibly cause the ELIFECYCLE
error.
I will close this issue if I can confirm this for myself.
@KyzaGitHub Can it be reproduced using Node.js?
I tried using only node-window-manager
and only desktopCapturer
separately for a long period of time. I could only reproduce it with desktopCapturer
.
The problem is definitely with Electron.