RFR: 8270489: Support archived heap objects in EpsilonGC [v2]
Aleksey Shipilev
shade at openjdk.java.net
Thu Aug 12 09:32:25 UTC 2021
On Wed, 11 Aug 2021 23:29:35 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> src/hotspot/share/gc/epsilon/epsilonHeap.cpp line 155:
>>
>>> 153:
>>> 154: // Allocation successful, update counters
>>> 155: if (Metaspace::initialized()) {
>>
>> Feels odd to protect this entire block. It handles generic allocations, not only the metaspace. (I suspect this is only relevant during the initial allocation at startup, but it still looks weird). Would moving a check to `EpsilonMonitoringSupport::update_counters()` and protecting `MetaspaceCounters::update_performance_counters();` there be enough?
>
> I can't move `if (Metaspace::initialized())` into `EpsilonMonitoringSupport::update_counters()` because the code in this function also updates the global variable `_last_counter_update`.
Yes, I understand that sacrifices the logging accuracy a bit: the `_last_counter_update` would include the initial CDS allocation. At the same time, I would not like to put `Metaspace::initialized()` checks on this (hot-when-not-TLAB) path, only to catch that initial allocation. So I suggest we add a boolean parameter like `allocate_work(size_t size, bool verbose)`, and call it with `false` from `allocate_loaded_archive_space`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5074
More information about the hotspot-dev
mailing list