You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there seems memory issue with Cypress (tried with 13.17.0 and 14.0.0)
I am using node JS with Cypress on test automation, to use npx cypress open to run the e2e test, but I the browser crashes at the JS VM heap size around 2GB. (it maybe node.js default memory limit is 2GB (for 64bit and 1.4GB for 32). I tried to configure the limit to 8GB by following ways:
in package.js, script block, use "test": "NODE_OPTIONS='--max-old-space-size=8192' npx cypress run", or "test": "NODE_OPTIONS='--max-old-space-size=8192' npx cypress open", (since I run my test by npx cypress open, then start e2e test).
in my cypress.config.js file, I tried to use:
e2e: {setupNodeEvents(on,config){on('before:browser:launch',(browser={},launchOptions)=>{if(browser.name==='chrome'||browser.name==='edge'){launchOptions.args.push('--js-flags=--max-old-space-size=9000');// Adjust MB size as neededlaunchOptions.args.push('--disable-dev-shm-usage');launchOptions.args.push('--js-flags=--expose-gc');launchOptions.args.push('--disable-gpu','--disable-background-timer-throttling','--disable-renderer-backgrounding','--disable-backgrounding-occluded-windows');}returnlaunchOptions;///} should not put here, seems the launchOptions not returned to use });
...
but with all above ways, the browser still crashes by the JS VM instance heap size reaches the default 2GB limit.
2) after the test run, the memory for JS VM instance heapsize does not drop much although we used all possible ways to limit the memory usage. It indicates there are memory leaks in current Cypress.
The text was updated successfully, but these errors were encountered:
I am working for IBM, and we chose to use Cypress for our automation framework since last year. I heard other team members got the memory leak and browser crashes as well. The error message is:
DevTools listening on ws://127.0.0.1:52142/devtools/browser/a3519c68-6998-4949-a574-5c4009ef121a
2025-01-30 15:16:05.075 Cypress[72360:1484147] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
We detected that the Chrome Renderer process just crashed.
We have failed the current spec but will continue running the next spec.
This can happen for a number of different reasons.
If you're running lots of tests on a memory intense application.
Try increasing the CPU/memory on the machine you're running on.
Try enabling experimentalMemoryManagement in your config file.
Try lowering numTestsKeptInMemory in your config file during 'cypress open'.
I've already verified both node js and chrome browser are set to 8GB for memory limit. But the test crashes the same once it reached the default memory limit (2GB)
there seems memory issue with Cypress (tried with 13.17.0 and 14.0.0)
npx cypress open
to run the e2e test, but I the browser crashes at the JS VM heap size around 2GB. (it maybe node.js default memory limit is 2GB (for 64bit and 1.4GB for 32). I tried to configure the limit to 8GB by following ways:package.js
, script block, use"test": "NODE_OPTIONS='--max-old-space-size=8192' npx cypress run"
, or"test": "NODE_OPTIONS='--max-old-space-size=8192' npx cypress open"
, (since I run my test bynpx cypress open
, then start e2e test).cypress.config.js
file, I tried to use:but with all above ways, the browser still crashes by the JS VM instance heap size reaches the default 2GB limit.
2) after the test run, the memory for JS VM instance heapsize does not drop much although we used all possible ways to limit the memory usage. It indicates there are memory leaks in current Cypress.
The text was updated successfully, but these errors were encountered: