So while running truffle compile for my contracts on AWS Ubuntu server I got the following error:

<--- Last few GCs --->

[17055:0x3985730]    11958 ms: Scavenge 511.7 (553.4) -> 506.9 (553.4) MB, 71.4 / 5.0 ms  allocation failure 
[17055:0x3985730]    12164 ms: Scavenge 518.3 (557.3) -> 515.9 (557.8) MB, 83.0 / 4.9 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: 0x8ccf9c [node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
 5: 0xa6552b [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: 0xd81903 [node]
13: v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [node]
14: 0x3bd2fb1042fd
Aborted (core dumped)

Can someone please help resolve this?

Run the following command at root: sudo du -sh ./*


15M     ./bin
69M     ./boot
0       ./dev
5.4M    ./etc
280M    ./home
0       ./initrd.img
0       ./initrd.img.old
166M    ./lib
4.0K    ./lib64
16K     ./lost+found
4.0K    ./media
4.0K    ./mnt
4.0K    ./opt
du: cannot access './proc/17290/task/17290/fd/4': No such file or directory
du: cannot access './proc/17290/task/17290/fdinfo/4': No such file or directory
du: cannot access './proc/17290/fd/3': No such file or directory
du: cannot access './proc/17290/fdinfo/3': No such file or directory
0       ./proc
56K     ./root
776K    ./run
15M     ./sbin
672M    ./snap
4.0K    ./srv
0       ./sys
56K     ./tmp
1.2G    ./usr
520M    ./var
0       ./vmlinuz
0       ./vmlinuz.old
  • 1
    Looks like you don't have enough memory. You can try upgrading your aws instance with more memory, or perhaps create a larger swap file. – Rosco Kalis Jan 8 '19 at 13:02
  • That's the first think I looked for. Let me share the details here as well. – Gagan Jan 8 '19 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.