spawn / fork中的Crystal Unhandled异常:无法分配内存

时间:2017-06-30 04:32:11

标签: compiler-errors crystal-lang

我一直在遇到这个水晶编译器错误,我目前看到除了重新启动我的盒子之外没有其他解决方法。我提交了issue here

crystal$ crystal build main.cr
Unhandled exception in spawn:
fork: Cannot allocate memory (Errno)
0x55b5be: ??? at ??
0x11184c5: ??? at ??
0x1516fc8: ??? at ??
0x55e178: ??? at ??
0x0: ??? at ??

是否有其他人遇到此问题,除了重启之外还知道如何修复它?

1 个答案:

答案 0 :(得分:2)

晶体编译器通常需要大量内存用于全局类型推断算法。因此,您可能需要更多空间来成功编译代码。

即使对于小程序,编译器也可能需要超过500 MB的内存。 如果你可以确保有2 GB可用,你应该能够编译大多数水晶程序。