Incerteza
Incerteza

Reputation: 34884

Can't run sbt on ec2 due to lack of memory (not being able to allocate new memory)

For some reason, I can't run sbt at amazon ec2 free tier

ubuntu@ip-xx-xx-xx-xx:~$ sbt seed
Loading /usr/share/sbt/bin/sbt-launch-lib.bash
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5550000, 715849728, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 715849728 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /home/ubuntu/hs_err_pid10392.log

Here is top:

ubuntu@ip-xx-xx-xx-xx:~$ top > 1.txt
ubuntu@ip-xx-xx-xx-xx:~$ cat 1.txt

top - 03:33:21 up 2 days,  2:41,  1 user,  load average: 0.00, 0.01, 0.05
Tasks:  66 total,   1 running,  65 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    603108 total,   438676 used,   164432 free,    34976 buffers
KiB Swap:        0 total,        0 used,        0 free,   337716 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND           
    1 root      20   0 26828 2172  924 S   0.0  0.4   0:01.05 init              
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kthreadd          
    3 root      20   0     0    0    0 S   0.0  0.0   0:00.01 ksoftirqd/0       
    4 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kworker/0:0       
    5 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kworker/0:0H      
    6 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kworker/u2:0      
 //....................

Note sbt seed does work at my local machine ("seed" is my custom task)

ubuntu@ip-xx-xx-xx-xx:~$ free
             total       used       free     shared    buffers     cached
Mem:        603108     438668     164440          0      35012     337720
-/+ buffers/cache:      65936     537172
Swap:            0          0          0

Upvotes: 0

Views: 1357

Answers (1)

datasage
datasage

Reputation: 19563

Micro instances come with 613 MB of physical memory total. You can enable swap if you need more, but keep in mind, that will be much slower.

Upvotes: 1

Related Questions