# HG changeset patch # User shade # Date 1527774287 -7200 # Node ID 224bfdcc645718e85fb3a9bdaa8cb77b16265081 # Parent ecdf81479e0ff7f93d5ff63af057eb079a5dad62 Print heap steps more verbosely, but also less frequently diff -r ecdf81479e0f -r 224bfdcc6457 src/hotspot/share/gc/epsilon/epsilonHeap.cpp --- a/src/hotspot/share/gc/epsilon/epsilonHeap.cpp Thu May 31 15:43:02 2018 +0200 +++ b/src/hotspot/share/gc/epsilon/epsilonHeap.cpp Thu May 31 15:44:47 2018 +0200 @@ -48,7 +48,7 @@ // Precompute hot fields _max_tlab_size = MIN2(CollectedHeap::max_tlab_size(), EpsilonMaxTLABSize / HeapWordSize); _step_counter_update = MIN2(max_byte_size / 16, EpsilonUpdateCountersStep); - _step_heap_print = (EpsilonPrintHeapStep == 0) ? SIZE_MAX : (max_byte_size / EpsilonPrintHeapStep); + _step_heap_print = (EpsilonPrintHeapSteps == 0) ? SIZE_MAX : (max_byte_size / EpsilonPrintHeapSteps); _decay_time_ns = (int64_t) EpsilonTLABDecayTime * NANOSECS_PER_MILLISEC; // Enable monitoring @@ -158,8 +158,10 @@ { size_t last = _last_heap_print; if ((used - last >= _step_heap_print) && Atomic::cmpxchg(used, &_last_heap_print, last) == last) { - log_info(gc)("Heap: " SIZE_FORMAT "M reserved, " SIZE_FORMAT "M committed, " SIZE_FORMAT "M used", - max_capacity() / M, capacity() / M, used / M); + log_info(gc)("Heap: " SIZE_FORMAT "M reserved, " SIZE_FORMAT "M (%.2f%%) committed, " SIZE_FORMAT "M (%.2f%%) used", + max_capacity() / M, + capacity() / M, capacity() * 100.0 / max_capacity(), + used / M, used * 100.0 / max_capacity()); } } diff -r ecdf81479e0f -r 224bfdcc6457 src/hotspot/share/gc/epsilon/epsilon_globals.hpp --- a/src/hotspot/share/gc/epsilon/epsilon_globals.hpp Thu May 31 15:43:02 2018 +0200 +++ b/src/hotspot/share/gc/epsilon/epsilon_globals.hpp Thu May 31 15:44:47 2018 +0200 @@ -45,13 +45,13 @@ constraint, \ writeable) \ \ - experimental(size_t, EpsilonPrintHeapStep, 100, \ + experimental(size_t, EpsilonPrintHeapSteps, 20, \ "Print heap occupancy stats with this number of steps. " \ "0 turns the printing off.") \ range(0, max_intx) \ \ experimental(size_t, EpsilonUpdateCountersStep, 1 * M, \ - "Update heap heap occupancy counters after allocating this much " \ + "Update heap occupancy counters after allocating this much " \ "memory. Higher values would make allocations faster at " \ "the expense of lower resolution in heap counters.") \ range(1, max_intx) \ diff -r ecdf81479e0f -r 224bfdcc6457 test/hotspot/jtreg/gc/epsilon/TestPrintHeapSteps.java --- a/test/hotspot/jtreg/gc/epsilon/TestPrintHeapSteps.java Thu May 31 15:43:02 2018 +0200 +++ b/test/hotspot/jtreg/gc/epsilon/TestPrintHeapSteps.java Thu May 31 15:44:47 2018 +0200 @@ -26,9 +26,9 @@ * @key gc * @requires vm.gc.Epsilon * @summary Tests -XX:EpsilonPrintHeapSteps works - * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc -XX:EpsilonPrintHeapStep=0 TestPrintHeapSteps - * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc -XX:EpsilonPrintHeapStep=1 TestPrintHeapSteps - * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc -XX:EpsilonPrintHeapStep=1000 TestPrintHeapSteps + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc -XX:EpsilonPrintHeapSteps=0 TestPrintHeapSteps + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc -XX:EpsilonPrintHeapSteps=1 TestPrintHeapSteps + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -Xlog:gc -XX:EpsilonPrintHeapSteps=1000 TestPrintHeapSteps */ public class TestPrintHeapSteps {