RFR: 8272609: Add string deduplication support to SerialGC [v10]
Albert Mingkun Yang
ayang at openjdk.java.net
Fri Aug 20 21:27:31 UTC 2021
On Fri, 20 Aug 2021 16:02:53 GMT, Denghui Dong <ddong at openjdk.org> wrote:
>> Hi team,
>>
>> Please help review this change to add string deduplication support to SerialGC.
>>
>> Thanks,
>> Denghui
>
> Denghui Dong has updated the pull request incrementally with one additional commit since the last revision:
>
> fix build error
src/hotspot/share/gc/serial/defNewGeneration.cpp line 606:
> 604: assert(heap->no_allocs_since_save_marks(), "save marks have not been newly set.");
> 605:
> 606: _string_dedup_requests.flush();
I wonder if placing `_string_dedup_requests.flush();` before weak roots processing (`WeakProcessor::weak_oops_do`) makes more senses. The documentation says `flush` should be called when marking is done; for Serial young GC, it's equivalent to when evacuation is done, which is right after ref-processing.
src/hotspot/share/gc/serial/genMarkSweep.cpp line 115:
> 113: deallocate_stacks();
> 114:
> 115: MarkSweep::_string_dedup_requests->flush();
Similarly, `flush` should be called inside `mark_sweep_phase1`, right after ref-processing.
src/hotspot/share/gc/serial/markSweep.cpp line 219:
> 217: MarkSweep::_gc_timer = new (ResourceObj::C_HEAP, mtGC) STWGCTimer();
> 218: MarkSweep::_gc_tracer = new (ResourceObj::C_HEAP, mtGC) SerialOldTracer();
> 219: MarkSweep::_string_dedup_requests = new StringDedup::Requests();
It's not clear to me why `_string_dedup_requests` is a pointer. Is it possible to define `static StringDedup::Requests _string_dedup_requests;` directly? That way, `Requests` doesn't need to use the inheritance.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5153
More information about the hotspot-gc-dev
mailing list