3 ms·
> With each object having around 96KB of private memory to itself For reference/comparison, by default with SMP and HiPE enabled an Erlang process is initialis
by masklinn 10y ago
> With each object having around 96KB of private memory to itself
For reference/comparison, by default with SMP and HiPE enabled an Erlang process is initialised at 338 words, including 233 words of heap memory (which contains the stack and will increase as needed) and the rest being process meta-information.
96KB private memory means you'd probably want to have "nursery" cores and process migration.
- stormpat 10y ago{_, mem} = :erlang.process_info(spawn(fn -> 1 + 1 end), :memory) mem -> 2720 bytes (~2.7kb)
- strmpnk 10y agoWhich is pretty close to 338 words on a 64bit system (338*8). Looks like it's taking 2 extra words there though. Curious.
- masklinn 10y agoErlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V8.1 (abort with ^G) > {memory, Mem} = erlang:process_info(spawn(fun () -> 1 + 1 end), memory). {memory,2704} > Mem div erlang:system_info(wordsize). 338 338 words is what the "Advanced: Memory" guide lists: http://erlang.org/doc/efficiency_guide/advanced.html http://erlang.org/doc/efficiency_guide/advanced.html > Erlang process 338 words when spawned, including a heap of 233 words. However note that this is with HiPE and SMP enabled (which afaik are now the default) as the "processes" guide notes[0] without both of these a process should be 309 words. Without SMP, I get 320 words (HiPE is a compilation flag and I don't feel like recompiling Erlang right now). [0] http://erlang.org/doc/efficiency_guide/processes.html http://erlang.org/doc/efficiency_guide/processes.html