RFR: 8350621: Code cache stops scheduling GC [v4]

Thomas Schatzl tschatzl at openjdk.org
Sun Jul 20 11:11:43 UTC 2025


On Sun, 20 Jul 2025 01:56:19 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Thomas Schatzl has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits:
>> 
>>  - Merge branch 'master' into 8350621-code-cache-mgmt-hang
>>  - * kbarrett-review
>>  - Merge branch 'master' into 8350621-code-cache-mgmt-hang
>>  - * more refactoring, comments
>>  - * kbarrett review part 2 (slightly incomplete)
>>  - * kbarrett review - 1
>>  - * initial kbarrett refactoring
>>  - * kbarret review:
>>      - restructure code in `try_collect_concurrently`
>>      - fix asserts - they only worked in the test because of whitebox being active
>>      - fix comments
>>    * threalmdoerr review:
>>      - fix test to be more lenient
>>  - * some whitespace fixes
>>  - 8350621
>>    
>>    Hi all,
>>    
>>      please review this change to avoid CodeCache triggered GCs temporarily being ignored.
>>    
>>    In particular, G1 does not make sure when its `collect()` method is called during a
>>    concurrent cycle, that a `Remark` pause that does code unloading etc. actually occurs
>>    after that request. This makes it so that some internal flag is not reset appropriately,
>>    stuck until the next code unloading (caused by e.g. a regular concurrent cycle being
>>    triggered).
>>    
>>    Testing: tier1-5
>>    
>>    Thanks,
>>      Thomas
>
> src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 1894:
> 
>> 1892:              cause == GCCause::_wb_breakpoint ||
>> 1893:              cause == GCCause::_java_lang_system_gc ||
>> 1894:              cause == GCCause::_dcmd_gc_run, "Unsupported cause %s", GCCause::to_string(cause));
> 
> My suggestion was to only check for the first 2 of these, as they are the only
> ones not (currently) covered elsewhere and prevented from getting here. Any
> causes other than those two would be surprising here.

I somehow thought they would end up here with `-XX:+ExplicitGCInvokesConcurrent`, but you are right after thinking again.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26189#discussion_r2217766027


More information about the hotspot-gc-dev mailing list