memory used by Erlang VM

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Sun Feb 2 21:47:47 CET 2020

RSS is the latter.

Your processes allocate virtual memory. It is mapped to physical memory
(and secondarily to the swap drive). RSS is the amount of memory currently
resident in the physical memory of the computer. It is genuinely used.

What makes it hard to predict is that you don't get it all straight away.
If I allocate 8 megabyte of contiguous memory via, e.g., mmap(), I'm
granted permission to access it (so the VM memory goes up). But since I
didn't touch the pages yet, RSS is not changing. As I start touching
memory, it is mapped in and physical pages are allocated. Typically in
either 4kb blocks or 2mb blocks. Contrast this with me memory mapping in a
file. Then when I access memory, I'm accessing the underlying file through
the disk cache. Also consider a fork. They use copy-on-write, so memory
will be allocated as the processes start diverging in the memory space by
doing different updates to different pages[0].

We also map libraries and the program code itself into the memory space.
But this is marked as read-only, so it can be shared among several
processes needing use of the same library.

[0] By default. You can memory map so things are shared.

On Sun, Feb 2, 2020 at 8:31 PM Max Lapshin <max.lapshin@REDACTED> wrote:

> So what is RSS?
> Is it a badly designed aggregate or some real value that is very hard to
> predict (just like it is hard to tell temperature when you know speed of
> several moleculas)?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the erlang-questions mailing list