3 ms·
> there is a major flaw in the erlang version which causes unnecessary list allocation and garbage collection multiplied by 1 million times. There's probably a
by masklinn 11y ago
> there is a major flaw in the erlang version which causes unnecessary list allocation and garbage collection multiplied by 1 million times.
There's probably an alloc cost, but there should be no GC cost: erlang processes get a 233 words heap by default, a list of 10 integers is 21 words, so the process should die without needing to run GC.
- nivertech 11y agoyes, when process ends/dies all the heap is reclaimed without regular GC. I also tried spawn_opt/5 with reduced min_heap_size option - it doesn't help.
- masklinn 11y ago> I also tried spawn_opt/5 with reduced min_heap_size option - it doesn't help. Yeah whether using spawn_opt or VM options (-hms and -hpds) it doesn't look possible to reduce the process heap (or process dict) below the initial size, only to increase it.