One thing I still dont get is how can ZGC be safe if it literally reserves all native memory available on the machine.
This or why NMT shows stupid numbers when using ZGC.
TBH the more I dived into JVM memory management the more disgusting it became.
You cant be sure of anything, its totally not straightforward, has many pitfalls and requires stupid amount of useless JVM only knowledge to work well.
Im starting to think that in containers age, an intermediate bytecode language is not needed anymore.
May be the reason why CPython or Go see such huge adoption in contenerised world.
Go's GC uses the same trick, and also shows a giant virtual size.
But you're right more broadly, it's nice to not have bad performance be a bunch of finger pointing between dev and ops with Go. With Java there's always another, untried GC twiddle to fix everything.
> With Java there's always another, untried GC twiddle to fix everything
That hasn’t been true since.. forever. If you have GC problems with Java, you are doing something stupid in 99% of the cases that can be easily fixed by any kind of profiler. That’s not true for most other GCd languages.
It's true, per default the jvm takes a bunch of memory. I have been successful with running complex java apps in very memory constrained environments though, choosing frameworks and the right -xmx value is usually enough, but yeah, the 30mb res region is not javas sweetspot, but 100mb res mem allowes leveraging much of the java ecosystem.
Well yes, because on Linux you use mmap to reserve virtual memory.
I wouldn't say that tooling is not aware of all that. For example, top and htop display virtual memory and resident memory and shared memory. You need to look at resident memory if you want to know physical memory usage.
What I meant by tooling not being aware is that its hard to pinpoint what exactly is using that memory.
Best you can do is do dumps, verify, enable NMT, verify.
It gives me no value to know that my heap is 60m, but my RSS is 600mb while reserved is 40GB. Need more details and those are not always provided i.e. “Unknown” category in NMT details.
Best is that top, pmap and nmt are all showing completely different values for resident size :> and its not a unit issue.
This or why NMT shows stupid numbers when using ZGC.
TBH the more I dived into JVM memory management the more disgusting it became.
You cant be sure of anything, its totally not straightforward, has many pitfalls and requires stupid amount of useless JVM only knowledge to work well.
Im starting to think that in containers age, an intermediate bytecode language is not needed anymore.
May be the reason why CPython or Go see such huge adoption in contenerised world.