Skip to content
Permalink
Browse files
8225216: gc/logging/TestMetaSpaceLog.java doesn't work for Shenandoah
Reviewed-by: shade
  • Loading branch information
kdnilsen authored and shipilev committed Mar 12, 2020
1 parent b0f32c4 commit 19e02810db5e0ebcceed7b751e81dc0995dff5a2
Showing with 23 additions and 21 deletions.
  1. +22 −20 src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
  2. +1 −0 test/hotspot/jtreg/TEST.groups
  3. +0 −1 test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java
@@ -178,6 +178,9 @@ void ShenandoahControlThread::run_service() {
if (gc_requested) {
heap->reset_bytes_allocated_since_gc_start();

// Use default constructor to snapshot the Metaspace state before GC.
metaspace::MetaspaceSizesSnapshot meta_sizes;

// If GC was requested, we are sampling the counters even without actual triggers
// from allocation machinery. This captures GC phases more accurately.
set_forced_counters_update(true);
@@ -187,28 +190,24 @@ void ShenandoahControlThread::run_service() {
ShenandoahHeapLocker locker(heap->lock());
heap->free_set()->log_status();
}
}

switch (mode) {
case none:
break;
case concurrent_traversal:
service_concurrent_traversal_cycle(cause);
break;
case concurrent_normal:
service_concurrent_normal_cycle(cause);
break;
case stw_degenerated:
service_stw_degenerated_cycle(cause, degen_point);
break;
case stw_full:
service_stw_full_cycle(cause);
break;
default:
ShouldNotReachHere();
}
switch (mode) {
case concurrent_traversal:
service_concurrent_traversal_cycle(cause);
break;
case concurrent_normal:
service_concurrent_normal_cycle(cause);
break;
case stw_degenerated:
service_stw_degenerated_cycle(cause, degen_point);
break;
case stw_full:
service_stw_full_cycle(cause);
break;
default:
ShouldNotReachHere();
}

if (gc_requested) {
// If this was the requested GC cycle, notify waiters about it
if (explicit_gc_requested || implicit_gc_requested) {
notify_gc_waiters();
@@ -244,6 +243,9 @@ void ShenandoahControlThread::run_service() {
heuristics->clear_metaspace_oom();
}

// Print Metaspace change following GC (if logging is enabled).
MetaspaceUtils::print_metaspace_change(meta_sizes);

// GC is over, we are at idle now
if (ShenandoahPacing) {
heap->pacer()->setup_for_idle();
@@ -242,6 +242,7 @@ tier2_gc_shenandoah = \
gc/ergonomics/TestInitialGCThreadLogging.java \
gc/ergonomics/TestDynamicNumberOfGCThreads.java \
gc/logging/TestGCId.java \
gc/logging/TestMetaSpaceLog.java \
gc/metaspace/TestMetaspacePerfCounters.java \
gc/metaspace/TestMetaspacePerfCounters.java \
gc/startup_warnings/TestShenandoah.java \
@@ -45,7 +45,6 @@
* java.management
* @requires vm.gc != "Epsilon"
* @requires vm.gc != "Z"
* @requires vm.gc != "Shenandoah"
*
* @compile TestMetaSpaceLog.java
* @run driver ClassFileInstaller sun.hotspot.WhiteBox

0 comments on commit 19e0281

Please sign in to comment.