[master] RFR: 8323192: [Lilliput] Implement new Serial Full GC [v2]

Roman Kennke rkennke at openjdk.org
Fri Jan 12 21:25:09 UTC 2024


> This implements a compressor-style compacting full-GC for the Serial GC, which does not require storing any forwarding pointers in object headers.
> 
> For a description of the algorithm, see the text block at the beginning of serialCompressor.hpp.
> 
> Notice that the algorithm uses extra memory: 1/64th of the heap-size is allocated for the marking bitmap and another 1/64th of the heap-size is allocated for the block-offset-table. On the other hand, it does not use storage for preserved-marks table, which is very unpredictable (often it is quite small, but if a workload churns locks or mass-i-hashes objects, it can become pretty large).
> 
> Performance:
> I tested performance using the following program, which exxagerates the performance impact of the algorithm. Real-world workloads would be more dominated by the copying.
> 
> 
> public class Retain {
>         static final int RETAINED = Integer.getInteger("retained", 10_000_000);
>         static final int GCS      = Integer.getInteger("gcs", 100);
>         static Object[] OBJECTS = new Object[RETAINED];
> 
>         public static void main(String... args) {
>                 for (int t = 0; t < GCS; t++) {
>                         for (int c = 0; c < RETAINED; c++) {
>                                 OBJECTS[c] = new Object();
>                         }
>                         System.gc();
>                 }
>         }
> }
> 
> 
> 
> The new algorithm can be tested by:
> `java -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:+UseCompressorFullGC -Xlog:gc*:file=compressor.txt Retain
> `
> 
> Average time for full-GCs on by machine:
>  - baseline: 394.61ms
>  - compressor: 411.61ms (+4.3%)
> 
> Testing:
>  - [x] tier1 +UseSerialGC +UseFullGCCompressor x86_64
>  - [x] tier1 +UseSerialGC +UseFullGCCompressor x86
>  - [ ] tier1 +UseSerialGC +UseFullGCCompressor aarch64
>  - [x] tier1 +UseSerialGC +UseCompactObjectHeaders x86_64
>  - [x] tier1 +UseSerialGC +UseCompactObjectHeaders x86
>  - [ ] tier1 +UseSerialGC +UseCompactObjectHeaders aarch64

Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:

  Don't use __builtin_popcount()

-------------

Changes:
  - all: https://git.openjdk.org/lilliput/pull/122/files
  - new: https://git.openjdk.org/lilliput/pull/122/files/f781c147..c2c4a011

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=lilliput&pr=122&range=01
 - incr: https://webrevs.openjdk.org/?repo=lilliput&pr=122&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/lilliput/pull/122.diff
  Fetch: git fetch https://git.openjdk.org/lilliput.git pull/122/head:pull/122

PR: https://git.openjdk.org/lilliput/pull/122


More information about the lilliput-dev mailing list