Closed Noogear closed 1 month ago
i have found the answer. https://github.com/oracle/graal/issues/2149
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
Using the new ZGC on GraalVM technically works though it disables a major optimization, I'll add a note.
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?