Report this

What is the reason for this report?

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

Posted on June 27, 2019

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


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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

Heya,

I’m sorry to hear about your experience. If you’re having issues with processes being killed due to memory issues you can start with examining the logs and also monitor the resource usage on your droplet.

You can check this article on how to monitor the resource usage on your droplet:

https://www.digitalocean.com/community/tutorials/how-to-use-top-netstat-du-other-tools-to-monitor-server-resources

When dealing with out-of-memory (OOM) issues on a Linux server, there are several key logs and tools that can help you diagnose and understand what is causing the memory exhaustion.

The kernel log often contains messages related to memory management, including out-of-memory (OOM) events. These messages can be found in /var/log/kern.log or through the dmesg command.

dmesg | grep -i oom

dmesg | grep -i "out of memory"

grep -i oom /var/log/kern.log

The general system log (/var/log/syslog or /var/log/messages) may also contain useful information about memory issues.

grep -i oom /var/log/syslog

grep -i "out of memory" /var/log/syslog

Adding a swap file can also benefit the performance.

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

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.