Getting error "Rebalance allocation failed - process out of memory" while build or run node-vuejs app

June 27, 2019 1.7k views
DigitalOcean Node.js Nginx

I am using ubuntu 18.04 1GB/25GB droplet.

⠇ building for production...
<--- Last few GCs --->

[13356:0x2d01d20]    47970 ms: Scavenge 419.9 (477.4) -> 419.9 (477.4) MB, 2010.2 / 16.4 ms  allocation failure
[13356:0x2d01d20]    53123 ms: Scavenge 420.0 (477.4) -> 419.9 (477.4) MB, 5087.1 / 13.7 ms  allocation failure
[13356:0x2d01d20]    55738 ms: Scavenge 420.0 (477.4) -> 420.0 (477.4) MB, 2579.4 / 6.1 ms  allocation failure
[13356:0x2d01d20]    63980 ms: Scavenge 420.0 (477.4) -> 419.9 (480.4) MB, 8227.6 / 137.3 ms  allocation failure


<--- JS stacktrace --->
Cannot get stack trace in GC.

FATAL ERROR: NewSpace::Rebalance Allocation failed - process out of memory

 1: node::Abort() [node]
 2: 0x8c20ec [node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
 5: 0xa2f43b [node]
 6: v8::internal::MarkCompactCollector::Evacuate() [node]
 7: v8::internal::MarkCompactCollector::CollectGarbage() [node]
 8: v8::internal::Heap::MarkCompact() [node]
 9: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
10: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
11: v8::internal::Factory::NewUninitializedFixedArray(int) [node]
12: 0xd4af53 [node]
13: v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [node]
14: 0x377335b042fd
Aborted
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! hashfav@1.0.0 build: `node build/build.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the hashfav@1.0.0 build 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!     /root/.npm/_logs/2019-06-27T06_15_55_973Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! hashfav@1.0.0 start: `npm run build && node server.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the hashfav@1.0.0 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!     /root/.npm/_logs/2019-06-27T06_15_56_005Z-debug.log
1 comment
  • Hi there @hashfav,

    The error you are getting would suggest that your server is running out of memory whilst trying to build your project. Do your usage graphs show this?

    You may be able to resolve this by allocating more memory to node or to your overall droplet.

    - Matt.

1 Answer

Creating SWAP can Temporaly resolve this problem (until you upgrade your droplet RAM).

https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.
Have another answer? Share your knowledge.