OS memory and erlang.memory() does not match

iex()2> :erlang.memory
[
  total: 44351460976,
  processes: 43448515616,
  processes_used: 43448139704,
  system: 902945360,
  atom: 1722569,
  atom_used: 1701352,
  binary: 155569120,
  code: 51306368,
  ets: 662070536
]

$ free -h
             total       used       free     shared    buffers     cached
Mem:           40G        18G        21G        56K       166M       942M
-/+ buffers/cache:        17G        22G
Swap:           0B         0B         0B

As you can see erlang is showing more memory vs available in a system.
How it’s possible ?

2 Likes