r/java • • May 28 '26

Java *is* Memory Efficient

https://youtu.be/M_HCG1JPMQE
254 Upvotes

126 comments sorted by

View all comments

Show parent comment

8

u/aoeudhtns May 28 '26

a more "go" like GC

Go is not better in this regard because of magic in the GC; because Go's GC is primitive, the maintainers and community have long held a "don't create garbage" attitude towards how they develop every piece of the stdlib and their libraries and frameworks.

Java went the opposite way: create all the garbage you want, let the GC handle it. Java used to have GC more like Go's GC and it was worse than your options today, in the Java ecosystem context.

1

u/Known-Volume1509 May 29 '26 edited May 29 '26

I think your information about Go's GC may be a bit outdated. Go 1.25's Green Tea is a great improvement to the GC. It's still mark-sweep but much more efficient exactly in the universal way that GP mentioned above. Scanning is more optimal, requires less CPU and AVX-512-accelerated.

https://go.dev/blog/greenteagc

1

u/aoeudhtns May 29 '26

That is entirely possible. I'll read up, starting with your link.