Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wait, are you saying Java performs worse if you give it more memory to work with?


No. More accurately: with very large heaps the default performance characteristics of the GC might be different than what you’d like it to be. For example you might get huge throughput but occasional long GC pauses.

But it’s all tunable.


It can.

GC pauses cause stuttering. More memory is a longer GC pause.

This is only the case if you allocate and deallocate a lot.

Also: never go larger than 32GiB on heap else you’ll end up with 64bit inter pointers: that will seriously degrade performance.


This very much depends on the GC you're using. But yes, a full GC will take longer the more memory you have. Therefore you want to avoid full GCs like the plague.


No. A bigger heap means more work for a memory manager. If you just give it more memory, but your app doesn't use it, no harm done.

Honestly Java in 2021 can handle huge heaps pretty well. Not sure which GC they are running.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: