8314629: Generational ZGC: Clearing All SoftReferences log line lacks GCId

Reviewed-by: eosterlund, tschatzl
This commit is contained in:
Guoxiong Li 2024-01-10 12:15:38 +00:00
parent 8d9479910f
commit 88dafe564f
2 changed files with 8 additions and 1 deletions

@ -113,6 +113,7 @@ static void list_append(zaddress& head, zaddress& tail, zaddress reference) {
ZReferenceProcessor::ZReferenceProcessor(ZWorkers* workers)
: _workers(workers),
_soft_reference_policy(nullptr),
_clear_all_soft_refs(false),
_encountered_count(),
_discovered_count(),
_enqueued_count(),
@ -124,8 +125,9 @@ void ZReferenceProcessor::set_soft_reference_policy(bool clear) {
static AlwaysClearPolicy always_clear_policy;
static LRUMaxHeapPolicy lru_max_heap_policy;
_clear_all_soft_refs = clear;
if (clear) {
log_info(gc, ref)("Clearing All SoftReferences");
_soft_reference_policy = &always_clear_policy;
} else {
_soft_reference_policy = &lru_max_heap_policy;
@ -438,6 +440,10 @@ public:
void ZReferenceProcessor::process_references() {
ZStatTimerOld timer(ZSubPhaseConcurrentReferencesProcess);
if (_clear_all_soft_refs) {
log_info(gc, ref)("Clearing All SoftReferences");
}
// Process discovered lists
ZReferenceProcessorTask task(this);
_workers->run(&task);

@ -41,6 +41,7 @@ private:
ZWorkers* const _workers;
ReferencePolicy* _soft_reference_policy;
bool _clear_all_soft_refs;
ZPerWorker<Counters> _encountered_count;
ZPerWorker<Counters> _discovered_count;
ZPerWorker<Counters> _enqueued_count;