[erlang-questions] VM with 32MB RAM
Dmitry Kolesnikov
dmkolesnikov@REDACTED
Mon Jul 10 18:23:51 CEST 2017
Hello,
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
http://erlang.org/faq/implementations.html
"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?
https://github.com/erlware/relx/blob/master/priv/templates/extended_bin#L37
* 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?
Best Regards,
Dmitry
More information about the erlang-questions
mailing list