scala - 由于内存不足(无法分配新内存),无法在 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' (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

这里是 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      
 //....................

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

最佳答案

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

关于scala - 由于内存不足(无法分配新内存),无法在 ec2 上运行 sbt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22469895/

相关文章:

ubuntu - ubuntu 上的 Appium 设置

java - Play 应用程序全局设置的混合

scala 重写 None

scala - 在 Shapeless 中,给定两条记录,我如何要求两条记录具有相同的键并将它们连接起来?

scala - Scaldi 依赖注入(inject)和 Akka Actors

mysql - EBean: java.lang.IllegalStateException: Bean 类 models.User 没有增强?

intellij-idea - Intellij 中的 Play Framework 新项目

scala - 编译器无法识别函数重载,因为类型已被删除。如何克服这一点?

shell - 使用 "become: true"在 Ansible 不工作的情况下更改默认 shell

java - 没有 USB 设备识别 libusbJava/ubuntu 13.04