PatrickJS / PatrickJS-starter

MFE Starter
MIT License
10.33k stars 4.89k forks source link

tests - FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory #371

Closed alvipeo closed 8 years ago

alvipeo commented 8 years ago

Got this problem - https://github.com/karma-runner/karma/issues/1954. Can't test anymore. Anyone had this issue?

I got it after upgraded all the packages and configs to the current in the repo.

PatrickJS commented 8 years ago

do you still have this problem after awesome-typescript-loader?

PatrickJS commented 8 years ago

I'm going to close this but if you still have this issue please open another one thanks

nadavsinai commented 8 years ago

I also got this problem, I'm not using your starter but a self written setup that is quite similar by using same versions of webpack,awesome-typescript-loader, karma etc.., If you get more info on the matter please update, I will do the same. (I would use the new +1 button but it doesn't seem to do the trick for this case -:)

ghost commented 8 years ago

Same problem here:

htmlLoader.customAttrAssig 68% 540/552 build modules <--- Last few GCs --->

168081 ms: Scavenge 1374.1 (1456.6) -> 1374.1 (1456.6) MB, 40.6 / 0 ms (+ 1.1 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep]. 169661 ms: Mark-sweep 1374.1 (1456.6) -> 1368.4 (1456.6) MB, 1579.9 / 0 ms (+ 2.8 ms in 5 steps since start of marking, biggest step 1.4 ms) [last resort gc]. 171178 ms: Mark-sweep 1368.4 (1456.6) -> 1373.9 (1456.6) MB, 1516.7 / 0 ms [last resort gc].

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x33c0cbee3ac1 1: instantiateSignature [/pipeline/source/node_modules/typescript/lib/typescript.js:~19228] [pc=0x23b83082b69f](this=0xd8ba2c0b869 ,signature=0x262c5fb9c829 <a SignatureObject with map 0x2bcb9c20ef49>,mapper=0xbd9101de369 <JS Function %28SharedFunctionInfo 0x366a8a06cd79%29>,eraseTypeParameters=0x33c0cbe04189 <undefined) 2: arguments adaptor frame: 2->3 3: getErasedS...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

alvipeo commented 8 years ago

This may be related - https://github.com/AngularClass/angular2-webpack-starter/issues/424

alvipeo commented 8 years ago

See my comment on https://github.com/AngularClass/angular2-webpack-starter/issues/424. Seems like all works with the latest packages.

nadavsinai commented 8 years ago

On my linux (fedora 23) this works well, but it happens all the time on the windows machine I am using at work. @alvipeo suggests using the typescript-awesome-loader in 0.16.0rc1 version, I will try it soon and let you know if it helps. another thing i noticed is that single run fails 100%, but running karma with no-single-run and watch options works sometimes, like about 50% of the times. I tried messing with starting Karma via node API whist running node with --max_old_space_size=xxxx which also seems to do something but it's very unpredictable and I could not find a reliable setup.

ghost commented 8 years ago

On our local development systems it is unpredictable if a build will succeed or not. But on our continuous delivery platform (Wercker) it fails all the time :-(

fxck commented 8 years ago

the build is definitely faster for me, but the "checking" in separate process is still taking up to 40 seconds and is oftentimes crashing

ghost commented 8 years ago

I have spent a lot of time to find out what is wrong. It looks like a 'large' application cannot be handled. I started with the empty webpack-starter and added my own application step by step. When I add all the Imports I need for my application then the build fails with out-of-memory error. When I remove a few, then it builds nicely. Probably the typescript loader doesn't free up memory properly...

ghost commented 8 years ago

This might be a related issue: https://github.com/mgechev/angular2-seed/issues/259

PatrickJS commented 8 years ago

yup related

ghost commented 8 years ago

Too bad. I had the plan to try my application with the angular-seed project to avoid webpack. But I might run into the very same issue....

PatrickJS commented 8 years ago

@kampdomoj any reason why you want to avoid webpack?

ghost commented 8 years ago

No. Only to go around this issue. But if it's a TSC issue, then I'll have it anyway... :(

ghost commented 8 years ago

Solved by adding more memory to node in the npm scripts section:

"build:prod": "node --max-old-space-size=4096 ./node_modules/webpack/bin/webpack --config webpack.prod.config.js --progress --profile --colors --display-error-details --display-cached  --bail",
"server:dev": "node --max-old-space-size=4096 ./node_modules/webpack/bin/webpack-dev-server --inline --progress --profile --colors --watch --display-error-details --display-cached  --content-base src/",
jvbianchi commented 8 years ago

This might be related: Microsoft/TypeScript#7609

jvbianchi commented 8 years ago

If you update (as a test) rxjs to 5.0.0-beta.3 this problem probably won't happen again.