vendure-ecommerce / vendure-docker-compose

A containerized Vendure server and storefront
MIT License
33 stars 37 forks source link

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory #2

Closed jruillier-afidium closed 3 years ago

jruillier-afidium commented 3 years ago

When I run docker-compose up on macOS...

During step : $ ng build --configuration=production,docker && ng run reference-storefront:server:docker

I get this error :

<--- Last few GCs --->

[28:0x4c9c270]   159920 ms: Scavenge 481.8 (497.4) -> 478.5 (497.6) MB, 7.1 / 0.0 ms  (average mu = 0.246, current mu = 0.142) allocation failure 
[28:0x4c9c270]   159984 ms: Scavenge 482.6 (497.6) -> 478.9 (497.6) MB, 1.5 / 0.0 ms  (average mu = 0.246, current mu = 0.142) allocation failure 
[28:0x4c9c270]   160815 ms: Mark-sweep 482.9 (497.9) -> 475.4 (497.9) MB, 744.1 / 0.0 ms  (average mu = 0.321, current mu = 0.385) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa04200 node::Abort() [ng build --configuration=production,docker]
 2: 0x94e4e9 node::FatalError(char const*, char const*) [ng build --configuration=production,docker]
 3: 0xb7978e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [ng build --configuration=production,docker]
 4: 0xb79b07 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [ng build --configuration=production,docker]
 5: 0xd34395  [ng build --configuration=production,docker]
 6: 0xd34f1f  [ng build --configuration=production,docker]
 7: 0xd42fab v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng build --configuration=production,docker]
 8: 0xd46b6c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [ng build --configuration=production,docker]
 9: 0xd1524b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [ng build --configuration=production,docker]
10: 0x105b23f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [ng build --configuration=production,docker]
11: 0x1401219  [ng build --configuration=production,docker]
Aborted (core dumped)
error Command failed with exit code 134.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c yarn build:ssr:docker' returned a non-zero code: 134
ERROR: Service 'storefront' failed to build
michaelbromley commented 3 years ago

Hi,

This looks like a memory issue. The ng build step is quite memory-intensive (in my experience needs at least 2GB RAM). Check your docker settings and see if you can allocate more memory to the container and try again.

jruillier-afidium commented 3 years ago

Hi, That was a noob question :p Thanks for you quick answer, and congratulations for this nice project :-)