Tyler
Tyler

Reputation: 19858

Crystal Unhandled exception in spawn/fork: Cannot allocate memory

I keep running into this crystal compiler bug and I currently see no workaround other than rebooting my box. I filed an 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 ??

Has anyone else ran into this, and know how to fix it other than rebooting?

Upvotes: 0

Views: 118

Answers (1)

Johannes Müller
Johannes Müller

Reputation: 5661

The crystal compiler typically requires much memory for the global type inference algorithm. So you're probably gonna need more space to successfully compile the code.

The compiler can require more than 500 MB of memory even for small programs. If you can make sure to have 2 GB available you should be able to compile most crystal programs.

Upvotes: 2

Related Questions