Mukul1127 / Minecraft-Performance-Flags-Benchmarks

Sane, Benchmarked Java Flags and Tweaks for Minecraft
https://github.com/Mukul1127/Minecraft-Java-Flags
MIT License
263 stars 5 forks source link

problem about "ZGC" #26

Closed Noogear closed 1 month ago

Noogear commented 1 month ago

ZGC employs a technique known as colored pointers. The idea is to use some free bits in 64-bit pointers into the heap for embedded metadata. However, when dereferencing such pointers, these bits need to be masked, which implies some extra work for the JVM. To avoid the overhead of masking pointers, ZGC involves multi-mapping technique. Multi-mapping is when multiple ranges of virtual memory are mapped to the same range of physical memory. ZGC uses 3 views of Java heap ("marked0", "marked1", "remapped"), i.e. 3 different "colors" of heap pointers and 3 virtual memory mappings for the same heap.

FROM: https://stackoverflow.com/questions/62926652/the-java-zgc-garbage-collector-uses-a-lot-of-memory

-XX:+UseZGC -XX:AllocatePrefetchStyle=1 -XX:-ZProactive In my tests, it does take up three times as much

-XX:+UseZGC -XX:AllocatePrefetchStyle=1 -XX:+ZGenerational However, when I use this ZGC parameter, it doesn't result in triple occupancy, but it does prompt me at the beginning: [0.001s][warning][gc,jvmci] Setting EnableJVMCI to false as selected GC does not support JVMCI: z gc What are the consequences of this?

Noogear commented 1 month ago

i have found the answer. https://github.com/oracle/graal/issues/2149

Noogear commented 1 month ago

I think it can be marked that ZGC will cause three times the memory usage, and the new-generation ZGC is incompatible with Graal. @Mukul1127

Mukul1127 commented 1 month ago

Using the new ZGC on GraalVM technically works though it disables a major optimization, I'll add a note.