RFR: JDK-8148733: G1: Add log message to print the heap region size

kirk.pepperdine at gmail.com kirk.pepperdine at gmail.com
Mon Feb 1 10:49:25 UTC 2016


Hi Bengt,

One of the modifications that is been very useful is to have this information printed at the top of the log.

Java HotSpot(TM) 64-Bit Server VM (25.45-b02) for linux-amd64 JRE (1.8.0_45-b14), built on Apr 10 2015 10:07:45 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
Memory: 4k page, physical 65968416k(38131748k free), swap 33559736k(33559320k free)
CommandLine flags: -XX:+AggressiveOpts -XX:CMSInitiatingOccupancyFraction=75 -XX:+DisableExplicitGC -XX:ErrorFile=/opt/logs/WEBLOGIC_4/hs_err_pid_%p.log -XX:+FlightRecorder -XX:InitialHeapSize=8589934592 -XX:MaxHeapSize=8589934592 -XX:MaxTenuringThreshold=6 -XX:NewRatio=3 -XX:OldPLABSize=16 -XX:OnOutOfMemoryError=kill -9 %p -XX:+PrintGC -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:ThreadStackSize=256 -XX:+UnlockCommercialFeatures -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:-UseGCOverheadLimit -XX:+UseParNewGC

However, when log rotation is in play you only get it in the initial log. It would be useful to have this information repeated at the top of each new file.

Regards,
Kirk

> On Feb 1, 2016, at 10:50 AM, Bengt Rutisson <bengt.rutisson at oracle.com> wrote:
> 
> 
> Hi everyone,
> 
> Could I have a couple of reviews for this small change to add a log message to print the heap region size?
> 
> http://cr.openjdk.java.net/~brutisso/8148733/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8148733
> 
> Currently the heap region size is not explicitly visible in the GC log files. Since G1 calculates the region size at startup and then sticks with that size, it is enough to log the region size once during initialization.
> 
> The new log message looks like this:
> 
> [0.013s][info   ][gc,heap] Heap region size: 1M
> 
> The test test/gc/logging/TestDeprecatedPrintFlags.java had to be updated to handle the padding in the logging of the tags. Before I added this message there was logging where the tags looked like this "[gc]", but since the new logging appears early in the log file these log message now look like "[gc     ]".
> 
> Thanks,
> Bengt
> 
> 



More information about the hotspot-gc-dev mailing list