[erlang-questions] VM with 32MB RAM
Mon Jul 10 18:23:51 CEST 2017
I’ve never raise a memory concern for Erlang application in the cloud. Recently, I though to fit as many independent Erlang releases as possible into cloud container cluster (AWS ECS). The memory is one of the dimension you have to control and provision, you need to declare application initial RAM and reserve its expansion.
Reading the Erlang documentation
"People successfully run the Ericsson implementation of Erlang on systems with as little as 16MByte of RAM. It is reasonably straightforward to fit Erlang itself into 2MByte of persistent storage (e.g. a flash disk)."
The VM claims significant amount of `system` memory when release is booted with embedded code loading strategy. For example a simples web echo server might require up to 45MB of memory with total initial memory budget for the application over 50MB. The interactive code loading strategy relax `system` memory consumption to 18MB with total application budget under 32MB. The `system` memory do not grow significantly (+/- 5MB) during the life cycle of this application.
Here is some questions
* Why there is such huge difference of system memory usage between embedded and interactive code loading strategy? It seems to me that embedded model load almost OTP libraries into memory even half of them are really used in the application?
* The default code loading strategy is interactive for OTP but relx makes it embedded. Why?
* What is your experience to use interactive code loading in the CLOUD production systems? Frankly speaking, I’ve always used embedded mode.
* Do you see an other techniques to reduce memory consumption besides 32-bit system and half-word emulator?
More information about the erlang-questions