This repository contains the code used in the paper Compressed Forwarding Tables Reconsidered, which explores a design that guarantees a low memory bound for forwarding information used by the GC. The design is evaluated on-top of generational ZGC.
cfw
contains the main contribution. Other branches cfw_partial_ordinal
, cfw_partial_vector_array
, cfw_partial_vector_inline
, cfw_coalesce
contains the main contribution and the optimization.
- Compare CFW with baseline generational
ZGC ...
or
git diff zgc_generational cfw
- Compare coalesce optimization with CFW or
git diff cfw cfw_coalesce
- Compare partial ordinal optimization with CFW or
git diff cfw cfw_partial_ordinal
- Compare partial vector array optimization with CFW or
git diff cfw cfw_partial_vector_array
- Compare partial inline vector optimization with CFW or
git diff cfw cfw_partial_vector_inline
Note that baseline generational ZGC is branched from openjdk/zgc/1bfcf4fe4ee6243bac9cf. A small patch is applied on the baseline in order to measure in bytes instead of megabytes to avoid truncation.
Building on Linux is required. We defer to the official OpenJDK tutorial for a detailed description on how to build. A minimal build configuration to use is bash configure --with-target-bits=64 --with-boot-jdk=/home/user/java/17.0.1-open
. You can build using make CONF=release
and will find the Java binary located at build/linux-x86_64-server-release/jdk/bin/java
.
For evaluation purposes, CFW comes with a flag (ZMaxOffHeap
) to dynamically control when it is activated. If it is not activated the default table in ZGC will be used. As an example -XX:ZMaxOffHeap=5.0
will activate CFW only if the forwarding table would use more than 5% of the configured Java max heap. The default value is set to 4.0%.
Moreover, we have modified the GC logger to display memory needed for forwarding information in bytes. This is enabled by supplying the flag -Xlog:gc*
. As an example the output would look something like:
[0,329s][info][gc,reloc ] GC(0) Forwarding Usage: 8451200B
So to evaluate CFW using h2 with a large input size from DaCapo one could write the following: build/linux-x86_64-server-release/jdk/bin/java -XX:+UseZGC -XX:ZMaxOffHeap=4.0 -Xlog:gc* -Xms1200m -Xmx1200m -jar /home/user/dacapo-9.12-MR1-bach.jar h2 -size large -n 30 -t 4
.