3 ms·
Ha! Absolutely no
by vcryan 4y ago
Ha! Absolutely no
- amelius 4y agoWhy not? JVM has a highly optimized concurrent GC.
- omginternets 4y agoIt’s a GC tuned for imperative languages that prefer mutation over allocation, which is the exact inverse of what BEAM needs.
- pron 4y agoOpenJDK's GCs do have elaborate mechanisms to support mutation, but if they're unused they impose no extra overhead.
- omginternets 4y agoI think you may be missing the point. What the JVM doesn't have is elaborate optimizations to support copies, e.g. a generational GC.
- NobleExpress 4y agoHm? G1 is a generational GC? And so is Serial/Parallel. And work on generational ZGC is ongoing [1]. Not sure what you're referring to here. [1]: https://openjdk.org/jeps/439 https://openjdk.org/jeps/439
- omginternets 4y agoI was mistaken!
- pron 4y agoThe JVM has a selection of four generational GCs. Two of them are the most sophisticated GCs available anywhere. It's not a matter of some unique brilliance. Java is simply in such high demand that it has the sufficient resources to have state of the art optimising compilers and GCs.
- omginternets 4y agoReally? I had no idea. Can you suggest further reading?
- pron 4y agohttps://docs.oracle.com/en/java/javase/20/gctuning/available-collectors.html https://docs.oracle.com/en/java/javase/20/gctuning/available... https://youtu.be/OhPGN2Av44E https://youtu.be/OhPGN2Av44E https://youtu.be/bLJJ3CY1aE8 https://youtu.be/bLJJ3CY1aE8
- toast0 4y agoErlang has a highly optimized concurrent GC as well. It's just optimized for different things. And maybe the concurrency of the GC is different; Erlang has one heap per process (aka green thread), and no concurrency within a heap. Erlang GC is also very simple and easy to understand because language features only allow references in one direction. Much of JVM GC complexity would be wasted as there's no need to look for reference loops and such, since they're not possible.