Skip to content

Commit

Permalink
8314629: Generational ZGC: Clearing All SoftReferences log line lacks…
Browse files Browse the repository at this point in the history
… GCId

Backport-of: 88dafe564f163ed738a8cb6adc449b94e606999f
  • Loading branch information
Liang Mao authored and shipilev committed Feb 21, 2024
1 parent 90c9f70 commit 36569de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/hotspot/share/gc/z/zReferenceProcessor.cpp
Expand Up @@ -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(),
Expand All @@ -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;
Expand Down Expand Up @@ -438,6 +440,10 @@ class ZReferenceProcessorTask : public ZTask {
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);
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/gc/z/zReferenceProcessor.hpp
Expand Up @@ -41,6 +41,7 @@ class ZReferenceProcessor : public ReferenceDiscoverer {

ZWorkers* const _workers;
ReferencePolicy* _soft_reference_policy;
bool _clear_all_soft_refs;
ZPerWorker<Counters> _encountered_count;
ZPerWorker<Counters> _discovered_count;
ZPerWorker<Counters> _enqueued_count;
Expand Down

1 comment on commit 36569de

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.