D
D
Dilik Pulatov2019-09-26 16:20:32
Node.js
Dilik Pulatov, 2019-09-26 16:20:32

Nuxt js Allocation failed - JavaScript heap out of memory, what's the problem?

Hello!
When a project is released to production, there is such a failure in the OS. And this happens when several people visit the
Ubuntu 18.04
Node js 12 OS site at the same time,
the project on Nuxt js works (in SSR mode)
when I checked the system on the CPU
5d8cba6e59808834179064.jpeg
, it turned out that Nodges loads the system and Nginx will return an error 502
and this is the error in the console

<--- JS stacktrace --->

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

Security context: 0x326f1d49e6e9 <JSObject>
    0: builtin exit frame: clear(this=0x275b07722b61 <Set map = 0x2a9ed88841f9>,0x275b07722b61 <Set map = 0x2a9ed88841f9>)

    1: get [0x23597456c931] [/var/www/iyb-frontend/node_modules/vue/dist/vue.runtime.common.prod.js:~6] [pc=0x16b4b178cbe2](this=0x275b07722a81 <un map = 0x293f53439679>)
    2: new constructor(aka un) [0x287f49e2ce01] [/var/www/iyb-frontend/node_modules/vue/dist/vue.runtim...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x8fa0c0 node::Abort() [node]
 2: 0x8fa10c  [node]
 3: 0xb0026e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb004a4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xef49b2  [node]
 6: 0xef4ab8 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
 7: 0xf00b92 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xf014c4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xf04131 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xecd226 v8::internal::Factory::AllocateRawArray(int, v8::internal::PretenureFlag) [node]
11: 0xecdaaa v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::Heap::RootListIndex, int, v8::internal::Object*, v8::internal::PretenureFlag) [node]
12: 0xecdb50 v8::internal::Handle<v8::internal::FixedArray> v8::internal::Factory::NewFixedArrayWithMap<v8::internal::FixedArray>(v8::internal::Heap::RootListIndex, int, v8::internal::PretenureFlag) [node]
13: 0x1059b37 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet, 1>::Allocate(v8::internal::Isolate*, int, v8::internal::PretenureFlag) [node]
14: 0x1059bf8 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet, 1>::Clear(v8::internal::Handle<v8::internal::OrderedHashSet>) [node]
15: 0x100dd83 v8::internal::JSSet::Clear(v8::internal::Handle<v8::internal::JSSet>) [node]
16: 0xba41f8 v8::internal::Builtin_SetPrototypeClear(int, v8::internal::Object**, v8::internal::Isolate*) [node]
17: 0x16b4b115bf7d
Aborted
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! [email protected] start: `nuxt start --max_old_space_size=3072 --optimize_for_size`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dilik/.npm/_logs/2019-09-26T12_51_31_381Z-debug.log

and each time is different
<--- Last few GCs --->

[4394:0x3efba20]    50300 ms: Scavenge 1376.2 (1424.7) -> 1375.8 (1425.7) MB, 14.7 / 0.0 ms  (average mu = 0.167, current mu = 0.072) allocation failure
[4394:0x3efba20]    51979 ms: Mark-sweep 1376.7 (1425.7) -> 1375.9 (1423.7) MB, 1665.8 / 0.0 ms  (average mu = 0.118, current mu = 0.075) allocation failure scavenge might not succeed
[4394:0x3efba20]    51992 ms: Scavenge 1376.8 (1423.7) -> 1376.5 (1425.2) MB, 8.6 / 0.0 ms  (average mu = 0.118, current mu = 0.075) allocation failure


<--- JS stacktrace --->

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

Security context: 0x12536f29e6e9 <JSObject>
    0: builtin exit frame: ownKeys(this=0x12536f2940b9 <Object map = 0x32d4246850c1>,0x24bce7425879 <Object map = 0x3e5c4213a961>,0x12536f2940b9 <Object map = 0x32d4246850c1>)

    1: /* anonymous */ [0x33efeb77c721] [/var/www/iyb-frontend/node_modules/vue/dist/vue.runtime.common.prod.js:~6] [pc=0x6e4b73529de](this=0x24bce7421229 <a map = 0xed4c9e78d39>)
    2: arguments adaptor frame: 1->0
    ...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x8fa0c0 node::Abort() [node]
 2: 0x8fa10c  [node]
 3: 0xb0026e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb004a4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xef49b2  [node]
 6: 0xef4ab8 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
 7: 0xf00b92 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xf014c4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xf04131 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xecd226 v8::internal::Factory::AllocateRawArray(int, v8::internal::PretenureFlag) [node]
11: 0xecdaaa v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::Heap::RootListIndex, int, v8::internal::Object*, v8::internal::PretenureFlag) [node]
12: 0xecdb50 v8::internal::Handle<v8::internal::FixedArray> v8::internal::Factory::NewFixedArrayWithMap<v8::internal::FixedArray>(v8::internal::Heap::RootListIndex, int, v8::internal::PretenureFlag) [node]
13: 0x1059b37 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet, 1>::Allocate(v8::internal::Isolate*, int, v8::internal::PretenureFlag) [node]
14: 0xfcf77f v8::internal::KeyAccumulator::AddKey(v8::internal::Handle<v8::internal::Object>, v8::internal::AddKeyConversion) [node]
15: 0xfd2569 v8::internal::KeyAccumulator::CollectOwnPropertyNames(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>) [node]
16: 0xfd2b24 v8::internal::KeyAccumulator::CollectOwnKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>) [node]
17: 0xfd37d5 v8::internal::KeyAccumulator::CollectKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSReceiver>) [node]
18: 0xfd3b06 v8::internal::KeyAccumulator::GetKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::KeyCollectionMode, v8::internal::PropertyFilter, v8::internal::GetKeysConversion, bool, bool) [node]
19: 0xbe2a4c v8::internal::Builtin_ReflectOwnKeys(int, v8::internal::Object**, v8::internal::Isolate*) [node]
20: 0x6e4b6fdbf7d
Aborted
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! [email protected] start: `nuxt start --max_old_space_size=3072 --optimize_for_size`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dilik/.npm/_logs/2019-09-26T12_54_46_112Z-debug.log

I tried to increase the memory with --max_old_space_size ohm but it did not help
, please tell me how to solve this problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question