Hacker News new | ask | show | jobs
by quotemstr 16 days ago
Why would you think that malloc/free style memory management is more efficient? Both functions can be quite expensive, and they work synchronously. GCes give you compaction, compressed pointers, and bump pointer young generation operation as well as offloading allocation machinery to threads other than your business logic one. It's manual memory management that's going the way of the dinosaur, and the current interest in manual memory management is a fad.
1 comments

But there's the GC pause. Fundamentally there's no way around that, though I'm sure there are lots of modern techniques to make it not a problem.
The GC pause hasn't been a problem for years. Myth that just won't die. Have you tried a modern latency-optimized JVM GC? No, it doesn't pause in any way you'll care about.

Now, free/Drop/etc. the root a tree of 100k nodes. That's a pause.

Golang still got that issue.
Go has had sub-microsecond pauses for years

It also uses much fewer pointers than Java, so fewer allocations and less pressure on the GC.

Correction: it has sub-millisecond pauses, IME.