4

I am chasing a problem: every few days my system crashes with

Slogan: eheap_alloc: Cannot allocate 600904 bytes of memory (of type "heap").
System version: Erlang/OTP 22 [erts-10.5.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

I used to have some OOM situations but they were caused by e.g. infinite loops causing messages queues to fill the entire memory. This time it is something different. The memory usage at the moment of crash reported by cdv was 6081 MB. The system runs on a VM with 14GB of RAM, and nothing else is on this VM. Memory monitoring shows stable usage on the level of 6GB consistent with crash dump. So at the moment of crash Beam had still 8GB available, yet it could not allocate 600k.

Not sure if this is relevant but most of the memory used by the system is in one Mnesia ETS table – at the moment of crash it was 5631 MB.

Anyone aware of possible cause of situation when Erlang cannot allocate memory, though plenty is still available?

Wojtek Surowka
  • 20,535
  • 4
  • 44
  • 51
  • 1
    Unfortunately I cannot provide an answer, but I toyed a little and it may be helpful to you: In the end, when ERTS does not have any already allocated memory available for a new element, it gets new memory with either `sys_alloc` (malloc) or `mseg_alloc` (anon mmap). Malloc only fails if there is no memory left for the process (RLIMIT? physical limit?). Mmap has some other failure cases, such as the maximum number of allowed mappings. Another thing to check should be if you are using `erts_alloc` flags – José M Jun 09 '20 at 22:12

0 Answers0