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

Roman Kennke rkennke at openjdk.org
Thu Feb 22 18:38:21 UTC 2024


On Fri, 12 Jan 2024 21:25:09 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> 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()

The proposed new full GC wouldn't work with compact identity hashcode, and is therefore not useful.

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

PR Comment: https://git.openjdk.org/lilliput/pull/122#issuecomment-1960034706


More information about the lilliput-dev mailing list