-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Comments
This is not a karma issue, try https://stackoverflow.com/questions/38558989/node-js-heap-out-of-memory |
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. |
@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. |
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? |
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. |
<--- 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.
The text was updated successfully, but these errors were encountered: