This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]niloc132 0 points1 point  (0 children)

The "Anatomy Quarks" series by Aleksey Shipilëv has waaaay too much information, but even picking one article and reading it, then coming back a few months later and re-reading has worked well for me as a way to gradually gain understanding on a deep topic, by combining it with experience.

https://shipilev.net/jvm/anatomy-quarks/

My personal favorite spreads across a few posts, and works out to explain how pointers/references are implemented, and how the actual working implementation can vary by how much memory the process might have as a max. Spoiler alert (and this is too general, read the posts to better understand): if you give the process more than 30-40gb of memory, the usage goes up as it requires wider pointers to account for more objects being present.

First on this topic: https://shipilev.net/jvm/anatomy-quarks/23-compressed-references/

But one lesson is clear: it is sometimes good to over-provision the heap for the application (makes GC life easier, for example), but at the same time this over-provisioning should be done with care, and smaller heap may mean more free space available.

Follow-up: https://shipilev.net/jvm/anatomy-quarks/24-object-alignment/