Scala Can';由于内存不足,无法在ec2上运行sbt(无法分配新内存)

Scala Can';由于内存不足,无法在ec2上运行sbt(无法分配新内存),scala,ubuntu,playframework,amazon-ec2,sbt,Scala,Ubuntu,Playframework,Amazon Ec2,Sbt,由于某些原因,我无法在amazon ec2免费层运行sbt 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'

由于某些原因,我无法在amazon ec2免费层运行sbt

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
下面是
顶部

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      
 //....................
注意
sbt seed
在我的本地机器上工作(
“seed”
是我的自定义任务)


微实例的物理内存总量为613MB。如果需要更多,您可以启用交换,但请记住,这样会慢得多。

如何?我可以启用它只是为了让“sbt种子”运行,然后再次禁用它吗?@Alex否,您可以启用交换,使其始终处于活动状态。它会占用你的一些磁盘空间。为什么?默认情况下,它将在重新启动后被禁用。您是否尝试减小sbt使用的堆大小?如何执行此操作取决于启动程序脚本。
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