[erlang-questions] Setting maximum amount of data allocated by an Erlang node.‏

Richard A. O'Keefe <>
Wed Sep 9 04:32:58 CEST 2015


On 5/09/2015, at 8:20 pm, Michael Truog <> wrote:
> Its a bit complex to track the exact amount of memory inside the Erlang VM in Erlang source code to do
> something useful with the information due to the various memory pools and the garbage collection.

Every year in the concurrent programming paper I
tell students "In a concurrent world there is no global NOW".
I point out that this means, for example, that any
answer to a question like "how much memory is in use NOW"
is either meaningless or out of date when you look at it.

More precisely, the only way an Erlang process could get
a definitive answer to "how much memory is in use NOW"
is if every process were frozen, garbage collected, and
then that one process resumed, not letting the others do
anything that might allocate (or free up) memory until it
has finished deciding what to about the result.  If you
needed concurrency in the first place, this would most
likely be a Bad Thing to Do.

So whatever the use case is, it will have to be content
with answers that are at best approximate and out of date.
And this would be so with *any* programming language,
including C++ and Java.

(For what it's worth, I'm familiar with the idea of a
"time-like slice" in General Relativity.  So "no global
NOW" is a very slight exaggeration.)




More information about the erlang-questions mailing list