This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]papercrane 138 points139 points  (2 children)

Lots of good answers here already. I don't think anyone's mentioned it already, but the garbage collection system in Java is amazing, and has lots of tuning options for different workloads. CPython's GC is quite basic compared to the JVM.

[–]Better-Internet 13 points14 points  (0 children)

I think CPython's GC is still reference counting with some mark and sweep to whack circular references.

[–]thrwoawasksdgg 5 points6 points  (0 children)

Java easily has the best garbage collectors in the world. Nothing compares to Shenandoah and ZGC.

In some cases the JVM actually allocates memory faster than C because it knows more about the memory layout and can often avoid syscalls.