Skip to content
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

Aw Snap Out Of Memory Issue #28662

Closed
UsmanKarim08 opened this issue Jan 8, 2024 · 15 comments
Closed

Aw Snap Out Of Memory Issue #28662

UsmanKarim08 opened this issue Jan 8, 2024 · 15 comments
Labels
type: duplicate This issue or pull request already exists

Comments

@UsmanKarim08
Copy link

Test code to reproduce

we have 476 teste cases in our project so far when we execute them together browser crash and give us Aw Snap Out Of Memory
error it happen when we run bunch of test cases together. But when we run the individually they run good. can you please help us to resolove that issue

Cypress Mode

cypress run

Cypress Version

v12.17.2

Browser Version

v120

Node version

v20.5.1

Operating System

windows 10

Memory Debug Logs

No response

Other

No response

@Greegko
Copy link

Greegko commented Jan 9, 2024

I have just had the same issue yesterday, as we do many combinations for exploration tests.

Even for a most simplified case it could be reproduced the memory leak:

import { range } from 'lodash-es';

describe('Find Memory Leak', () => {
  range(1, 500).forEach((i) => {
    it('Yeah - ' + i, () => {
      cy.visit('https://google.com');
      cy.get('body').click();
    });
  });
});

After 140 / 500 the memory is already 3 GB (Cypress Helper (Renderer) on mac resource monitor terminal). I set the config: screenshotOnRunFailure: true even to true to make sure it should be empty.
Tried with Chrome and Electron as well, with 13.2.0 and 13.6.2 versions as well.
It seems doesn't matter if the test fails or is success. I thought the similar issue raised again as #18549, but haven't seen any similarity yet.

Upd:

It even crashed with the following message

<--- Last few GCs --->

[46350:0x148008000]   432069 ms: Mark-Compact (reduce) 2709.6 (3276.9) -> 2708.1 (3243.0) MB, 2659.42 / 0.04 ms  (average mu = 0.107, current mu = 0.022) last resort; GC in old space requested
[46350:0x148008000]   434541 ms: Mark-Compact (reduce) 2708.1 (3243.0) -> 2707.8 (3226.3) MB, 2470.33 / 0.00 ms  (average mu = 0.058, current mu = 0.001) last resort; GC in old space requested


<--- JS stacktrace --->

[46350:0109/153626.318295:ERROR:v8_initializer.cc(753)] V8 javascript OOM (CALL_AND_RETRY_LAST).
We detected that the Electron 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'.

You can learn more here:

https://on.cypress.io/renderer-process-crashed

Upd: I didn't mention but all those configs adjustment didn't help, settings keptInMemory to 5, and run in chrome with MemoryManagement resulted the same issue.

@banjahman
Copy link

I've been experiencing the same thing with our suite, it's been a problem for over a year. I've been working on finding a workaround but haven't been able to yet. It's definitely an issue with Cypress.

@akshaygupta5233
Copy link

I too agree with this, running many test cases at once is throwing this error!
I tried with below configs also, still the same error
numTestsKeptInMemory: 0,
experimentalMemoryManagement: true,

@ivanharalampiev
Copy link

at this point imo the best solution is to migrate to playwright like the rest of the world. cypress is just shrugging issues under the rug and calling it a day. just search for all the OOM issues reported before and you'll have pretty good idea what will happen to this one.

@bensouth
Copy link

bensouth commented Feb 9, 2024

Same for me. No fix.

@banjahman
Copy link

at this point imo the best solution is to migrate to playwright like the rest of the world. cypress is just shrugging issues under the rug and calling it a day. just search for all the OOM issues reported before and you'll have pretty good idea what will happen to this one.

I recently starting porting our codebase over to playwright. It's very similar in syntax, so the migration is pretty easy. Playwright runs faster, better, more reliably, has more features, and costs far less. At this point sticking with Cypress is shooting yourself in the foot. I tried to give them a chance to fix the show stopping issues but all that ever gets done are closed issues without any resolution.

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Feb 16, 2024
@Jacek-fstack
Copy link

Same thing for me - never was an issue with Electron, but here we are

@LukasLewandowski
Copy link

Any update on this? Workaround? It is a blocker for executing more tests on CI as memory is not released between tests.

@Jacek-fstack
Copy link

Any updates @jennifer-shehane ?

@Jacek-fstack
Copy link

@banjahman how long did it take you to migrate to Playwright? How many tests did you have?

@stepanroznik
Copy link

For me, changing the Cypress version from 3.11.0 to 3.6.0 helped. Might work as a workaround for some. I also have experimentalMemoryManagement enabled.

@jennifer-shehane
Copy link
Member

@stepanroznik It'd be great to have an example for us to reproduce this. We/d be very interested in tracking down a performance regression.

@maoyu-test
Copy link

This problem has been bothering me for two years now

@Greegko
Copy link

Greegko commented Jul 10, 2024

@stepanroznik It'd be great to have an example for us to reproduce this. We/d be very interested in tracking down a performance regression.

Hey, as mentioned the second comment even the most basic tests crash: #28662 (comment)

@jennifer-shehane
Copy link
Member

Going to close this as a duplicate of #27415 (comment)

@jennifer-shehane jennifer-shehane closed this as not planned Won't fix, can't repro, duplicate, stale Jul 30, 2024
@jennifer-shehane jennifer-shehane added type: duplicate This issue or pull request already exists and removed stage: needs investigating Someone from Cypress needs to look at this type: performance 🏃‍♀️ Performance related labels Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests