I mentioned this in gitter last week or so, but I think the lead devs should be aware of it. I don’t think it’s normal behavior (might be a bug).
crystal app.cr, the memory usage will shoot up about 500MB of ram (normal because the compiler uses it), but then after your app has started, that memory is still allocated. In fact, all the processes of the compiler are still running
I’m trying to find a workaround where we can compile our Crystal app, then execute it without the compiler still running.
I’ve got a MasterServer.cr that eats up around 500MB, then my GameServer that eats up another 500MB while only having 8GB of total ram.
My GameServer and MasterServer apps only utilize several MBs of ram when executed without the compiler in the background. This is how it should be after the compiler has finished, right?
I was thinking of something like
crystal build src/GameServer.cr --release && ./GameServer
But don’t know how to cancel the compiler processes through commands cause it has a list of PIDs
I’ve tested this on native Debian 9, and WSL’s Ubuntu
no compiler in the background:
compiler processes still in background:
edit: Or, maybe a compiler flag that automatically kills all the compiler processes after compilation is done? Not sure, just thinking out loud