rabbitmq / rabbitmq-common

Common library used by rabbitmq-server and rabbitmq-erlang-client
Other
66 stars 112 forks source link

To alarm when the Erlang process memory is greater than the free memory #351

Closed tomyouyou closed 4 years ago

tomyouyou commented 4 years ago

%% In practice Erlang shouldn't be allowed to grow to more than a half %% of available memory. The pessimistic scenario is when the Erlang VM %% has a single process that's consuming all memory. In such a case, %% during garbage collection, Erlang tries to allocate a huge chunk of %% continuous memory, which can result in a crash or heavy swapping. Copied from vm_memory_monitor.erl

So if memory the Erlang process consumed is greater than the free memory of the OS, the Erlang GC might not work.

The PR only deals with the Linux OS at present.

michaelklishin commented 4 years ago

Thank you but we won't be changing when the alarm mechanism is triggered. It can be perfectly reasonable and expected by the operator for a node to use more RAM than is free, say, when the free memory watermark uses a high value such as 0.8 or even more.