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
Javascript heap out of memory #22419
Comments
This may be fixed by #22460 |
Thanks, is this fix available in 10.2.0? |
we plan to release it tomorrow. |
Thank You! |
this might be next week.... sorry 😓 |
Could you try the 10.3.0 release? We fixed a memory leak that might be causing this issue. |
Yes, I will try today and let you know more inforamtion. |
I've run all tests with 10.3.0 version, and also I've migrated the solution but after each test, the application instance is killed and the next test has a problem with the state of the application. This wasn't the case with previous versions 9 and 8. |
Additional information: - seems that the test clears some flags from local storage during executing steps (usually the first step for login to application). |
90 minutes is one heck of a long run. Over that time, I'm guessing there's a memory leak somewhere that's eventually causing this issue. Just to clarify; you run all tests specs, sequentially, on your local machine (as opposed to a CI machine)?
Your post says you are on 9.4.1 - can you confirm this issue is happening on 9.4.1, or only since migrating to 10? My understanding is this was not happening with older versions of Cypress 9, but is now happening on Cypress 9.4.1? Since moving to Cypress 10, is it the same, or a different problem? You mention "but after each test, the application instance is killed and the next test has a problem with the state of the application" - which seems like, since moving to Cypress 10, there's a different issue? So, please clarify:
|
Yes sorry, on 9.4.1 I get an error without memory. After that, I installed version 10.3.0 and ran all the tests, but after a few tests my tests started to crash and I can't fully test if we still have out of memory.
I will try to determine exactly what the reason is but I am not sure if the reason is cypress or the problem is in the application but the same application when I run on 8.1 or 9.4.1 we have no problem with localStorage. When we solve this problem with localStorage then I can run all the tests and check if the problem with out of memory has been fixed. 8.1 version works correct (there is no problem with either memory or localStorage). |
Thanks for the reply. Let's start with the latter issue, around localStorage in Cypress 10. We generally don't patch older versions, like 9.4.1, so I think it's best to focus on the 10.x issue first, and go from there.
So to clarify, when you say a step you are referring to a command, eg
Is there any chance of a minimal reproduction? What do you mean by "refresh" here? Sorry for all the questions - I'm trying to understand what I need to do to actually reproduce this. Happy to go back and forth, but it might be quicker if you can share a minimal reproduction - it sounds like the issue doesn't need a server/backend application at all - instead of logging in, you could just create a project that sets the local storage in a |
Yes, I know that cypress clears localStorage after each test but if I have one test with few steps (login, open custom form, customize form - add new input or checkbox on the form, set some values on a form and save for example) When user login When I say "refresh" localStorage, I mean update localStorage with new applicationState (current arrangement of elements on the form, the appearance of the form). After login, we get the state from DB and save this data in localStorage. If the user adds a new form or new element to the form, we update localStorage with a new applicationState. In the background, we have a function that periodically fetches the value from localStorage and saves it to DB (every 5 seconds). Problem is following:
|
|
Cypress will only clear localStorage before each test - we don't do anything specific during the test, so unless your test case is modifying localStorage, it will not change. |
Hi, I also get Heap out of memory when running tests on CI. |
Oh nice debugging! This is useful. The What plugins are you using? Either
If it's the latter, we can definitely fix it, need to figure out what's going on. If I was debugging, I'd incrementally remove plugins and try to isolate which one(s) might be causing this. |
in our case the issue turned out the 'ts-loader' version "5.3.3". Once updated to "8.1.0" the memory leak got fixed. |
Nice - always good to update dependencies, glad that fixed it for you. I wonder if it can help the OP. |
@Chili82, Could you check your version of |
Yes, I will check as soon as possible. Currently I'm on vacation, but I will let you know next week. Thank you |
Current behavior
Hi, I have about 200 scenarios in 15 feature files and in headless mode (electron) every time I get a memory issue error (approx after 90 min from the start of tests).
I've set env variable in cypress.env.json but this setup is not resolved this problem.
My company is interested in buying a cypress license but this is our blocker. We also went through the whole code and did the optimization, each test is completed in about 30 - 50 seconds but we still have a problem. Please who can help with this serious issue
Desired behavior
No response
Test code to reproduce
{
"NODE_OPTIONS": "--max_old_space_size=8192",
"ELECTRON_EXTRA_LAUNCH_ARGS":"--js-flags=--expose_gc"
}
Cypress Version
9.4.1
Other
No response
The text was updated successfully, but these errors were encountered: