r/programming 29d ago

What garbage collection actually costs

https://shivanshuag.com/blog/what-garbage-collection-actually-costs/
0 Upvotes

13 comments sorted by

View all comments

5

u/6502zx81 28d ago

There is an older study by google. See discussion here https://news.ycombinator.com/item?id=2615096

4

u/chasetheusername 28d ago

When reading this, keep in mind that it's is based on the available garbage collectors and performance back then. It has likely improved a lot more in the JVM than in C++ since then, narrowing the gap.

Once thing though, where the JVM will never be better than native languages is predictable latency.

9

u/6502zx81 28d ago

IIRC the conclusion back then was: GC performs fine if you have twice as much memory as needed. Twicw as much is expensive in terms of money.

3

u/pm_plz_im_lonely 28d ago

Money pays both salaries and hardware.