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

JavaScript heap out of memory when run karma start #3031

Closed
ietabhi opened this issue Jun 8, 2018 · 7 comments
Closed

JavaScript heap out of memory when run karma start #3031

ietabhi opened this issue Jun 8, 2018 · 7 comments

Comments

@ietabhi
Copy link

ietabhi commented Jun 8, 2018

<--- Last few GCs --->
[5616:00000212BE116EF0] 942600 ms: Mark-sweep 1885.6 (1915.3) -> 1885.6 (1914.8) MB, 1692.8 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 000000E336325879
1: set(this=000003EEE62B15B1 ,0000027383806E49 <String[180]: c:/$recycle.bin/s-1-5-21-854245398-1972579041-362288127-2049712/$r62t0oj/cache/v1/npm-caniuse-lite-1.0.30000851-3b498aebf9f92cf6cff4ab54d13b557c0b590533/data/features/ogg-vorbis.js>,000002738380B889 ) 2: acquireOrUpdateDocument(aka acquireOrUpdateDocument) [C:......
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node_module_register
2: v8::internal::FatalProcessOutOfMemory
3: v8::internal::FatalProcessOutOfMemory
4: v8::internal::Factory::NewFixedArray
5: v8::internal::HashTablev8::internal::SeededNumberDictionary,v8::internal::SeededNumberDictionaryShape::IsKey
6: v8::internal::Dictionaryv8::internal::SeededNumberDictionary,v8::internal::SeededNumberDictionaryShape::AtPut
7: v8::internal::compiler::RawMachineAssembler::MakeNode
8: 0000007D733043C1
error Command failed with exit code 3.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@johnjbarton
Copy link
Contributor

@ThomasStubbe
Copy link

I got the same issue... it's some combination of babel and karma. Babel itself runs perfectly, it's only on karma that it has issues

@j-mcgregor
Copy link

I got the same issue... it's some combination of babel and karma. Babel itself runs perfectly, it's only on karma that it has issues

I know its been a while but did you ever fix this?

@Zachalot
Copy link

Zachalot commented Feb 10, 2021

I got the same issue... it's some combination of babel and karma. Babel itself runs perfectly, it's only on karma that it has issues

I know its been a while but did you ever fix this?

The only way that I was able to fix this was to increase the size of the memory heap every time I run my karma tests by running node --max-old-space-size=4096 every time I run my karma tests right before I run karma.

It's pretty clear to me that karma has a memory leak. There is no reason that a unit testing framework requires 4GB of RAM just to run your unit tests.

I don't buy johnjbarton's assertion that this isn't a karma issue. The solution to solving a memory leak shouldn't be to feed more memory to the memory leak. It should be to fix the memory leak.

@devoto13
Copy link
Collaborator

devoto13 commented Feb 10, 2021

@Zachalot Please set up a minimal project exhibiting this problem and push it to GitHub, so I can clone it, run and see the reported error. Without such a reproduction there is nothing we can do to identify the root cause of the problem and fix it. This may be a Karma bug (which I highly doubt), but this also may be a bug elsewhere or a misconfiguration in your project.

@johnjbarton
Copy link
Contributor

It's pretty clear to me that karma has a memory leak.

Seems unlikely as we run many thousands of tests on many large apps across multiple frameworks and products. So the question here is what are you doing that is different?

@neelupadhyay01
Copy link

I have faced the similar issue while running the js test cases build was throwing out of memory error.This issue was there when we upgraded to Node 14.For us upgrading karma version and its dependencies in package json and then do clear build has fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants