RFR (S): 8245088: Always provide logs for G1 heap expansion calculations

Kim Barrett kim.barrett at oracle.com
Mon May 18 14:23:08 UTC 2020


> On May 18, 2020, at 4:23 AM, Thomas Schatzl <thomas.schatzl at oracle.com> wrote:
> 
> Hi all,
> 
>  I would like the heap ergonomics code which determines by what amount to expand to always print internal state, not only on changes.
> 
> Since heap expansion is based on long term (and short term) application behavior, getting only information when something happened is too late to understand the results.
> 
> The gc+ergo+heap=debug log message has also been changed to include all interesting information; there is a new trace level message that tracks our low-pass filter.
> 
> CR:
> https://bugs.openjdk.java.net/browse/JDK-8245088
> Webrev:
> http://cr.openjdk.java.net/~tschatzl/8245088/webrev/
> Testing:
> hs-tier1-5
> 
> Thanks,
>  Thomas

------------------------------------------------------------------------------ 
src/hotspot/share/gc/g1/g1HeapSizingPolicy.cpp 
  66 static void log(const char* prefix,

I think I'd prefer this be called log_expanion.

------------------------------------------------------------------------------ 
src/hotspot/share/gc/g1/g1HeapSizingPolicy.cpp 
  98     log("Heap expansion: Can not expand (heap already fully expanded)",

Is the "Can not expand..." phrase actually needed?  That information
is also provided by the "fully expanded" part of the message, as well
as the "resize by" being 0.

That phrase makes this case visually stand out more, but pushes
interesting information way over to the right, possibly requiring
horizontal scrolling to see, depending on one's window size.

That phrase also makes it just a little bit harder to use egrep to
search for and parse these messages from a log file.

If that went away, the prefix would be identical for all callers, and
could be dropped and hard-coded in the log_debug invocation.

------------------------------------------------------------------------------
src/hotspot/share/gc/g1/g1HeapSizingPolicy.cpp 
  76                             "threshold %1.2f%% pause time ratio %1.2f%% fully expanded %d "
...
  83                             fully_expanded,

We have BOOL_TO_STR to print booleans as true/false rather than 1/0.

Alternatively, I think this isn't providing any additional information
beyond what one gets from "resize by" being 0.

------------------------------------------------------------------------------



More information about the hotspot-gc-dev mailing list