News for hackers. Stuff that matters.
Re:How much memory is needed to run 1M Erlang processes? by hauleth on Saturday June 10, 2023 @03:15PM (#36273991)
Author here. If you have any questions, here I am.
Re:How much memory is needed to run 1M Erlang processes? by mikece on Saturday June 10, 2023 @04:10PM (#36274570)
Less that 1 GB... that's impressive! Now I'm wondering how much memory Go or Java would require.
Re:How much memory is needed to run 1M Erlang processes? by justinclift on Sunday June 11, 2023 @09:57AM (#36281415)
Heh Heh Heh, now do Python... ;)
Re:How much memory is needed to run 1M Erlang processes? by hauleth on Sunday June 11, 2023 @11:45AM (#36282458)
It is in the original article [1], though I was made aware that Go implementation is also incorrect as `defer` in it make the memory usage to substantially raise. So instead of:

        defer wg.Done()
        time.Sleep(10 * time.Second)
In original article it should be:

        time.Sleep(10 * time.Second)
        wg.Done()
And memory usage will drop about 2x. I am no Go nor Java developer so I cannot say anything more.

[1]: https://pkolaczk.github.io/memory-consumption-of-async/

Re:How much memory is needed to run 1M Erlang processes? by bsaul on Sunday June 11, 2023 @11:51AM (#36282507)
Not an erlang dev here, but isn’t this blog optimizing for the benchmark, by cutting features that we would have needed in real-world scenarios ?
Re:How much memory is needed to run 1M Erlang processes? by hauleth on Sunday June 11, 2023 @02:44PM (#36284336)
Yes it is. Though until the last paragraph everything is done more or less to be an idiomatic approach to this task rather than "just optimisation". The VM flags part though is solely "optimizing for the benchmark, by cutting features that we would have needed in real-world scenarios". The "RemoteCall" code is pretty idiomatic approach to such problem.
Re:How much memory is needed to run 1M Erlang processes? by bsaul on Sunday June 11, 2023 @04:07PM (#36285079)
i have the feeling the very first optimization ( not using the VM real green thread, but something lighter that doesn't provide debugging tools) is also something you wouldn't like to have in the real world..
Re:How much memory is needed to run 1M Erlang processes? by hauleth on Sunday June 11, 2023 @05:55PM (#36286137)
It is using VM green thread, just more primitive one. Just to be more like other implementations (except anode) in original article that do bare minimum to run. Also, this isn't that unusual to use just `spawn/1` for simple and short "one-off" processes.