logoalt Hacker News

How ZGC allocates memory for the Java heap

80 pointsby lichtenberger04/23/202514 commentsview on HN

Comments

pron04/23/2025

For relevant upcoming changes see Automatic Heap Sizing for ZGC: https://openjdk.org/jeps/8329758

gopalv04/23/2025

The 32x virtual memory to physical memory ratio plays into relocation and colored pointers (i.e pointers where some bits serve as flag bits).

Putting the actual data layouts in 44 bits out of 64 is a neat trick which relies on the allocator being aware of the mappings between physical and virtual addresses.

show 2 replies
dL-9vP3xZq04/23/2025

[dead]