3 ms·
How much memory is needed to run 1M Erlang processes?
- hauleth 3y agoAuthor here. If you have any questions, here I am.
- mikece 3y agoLess that 1 GB... that's impressive! Now I'm wondering how much memory Go or Java would require.
- deleted 3y ago[deleted]
- justinclift 3y agoHeh Heh Heh, now do Python... ;)
- hauleth 3y agoIt 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/ https://pkolaczk.github.io/memory-consumption-of-async/
- bsaul 3y agoNot 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 ?
- hauleth 3y agoYes 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.
- bsaul 3y agoi 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..
- hauleth 3y agoIt 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.