Search code examples
javajvmjava-11corretto

JVM 11 flag PrintHeapAtGC not recognized by Amazon's Corretto JVM 11


Ran into this, the weird thing is, I can't find any pages about it. Searching for "PrintHeapAtGC not recognized" on google results in nothing helpful. In fact, it results in thread talking about how people are using it in JVM 11 with no problem.

I've printed the flags I use one per line, perhaps it's because of some combination I don't know is even a combination?

How do I even check that?

Can someone have a look at this and tell me what's wrong?

-XX:+ExitOnOutOfMemoryError 
-XX:NewRatio=3 
-XX:SurvivorRatio=4 
-XX:TargetSurvivorRatio=90 
-XX:MaxTenuringThreshold=8 
-XX:+UseParallelGC 
-XX:ParallelGCThreads=4 
-XX:+CMSScavengeBeforeRemark 
-XX:PretenureSizeThreshold=64m 
-XX:+UseCMSInitiatingOccupancyOnly 
-XX:CMSInitiatingOccupancyFraction=50 
-XX:CMSMaxAbortablePrecleanTime=6000 
-XX:+CMSParallelRemarkEnabled 
-XX:+ParallelRefProcEnabled 
-XX:-OmitStackTraceInFastThrow -verbose:gc 
-XX:+PrintHeapAtGC 
-XX:+PrintGCDetails 
-XX:+PrintGCDateStamps 
-XX:+PrintGCTimeStamps 
-XX:+PrintTenuringDistribution 
-XX:+PrintGCApplicationStoppedTime -Xloggc:/tmp/gc.log 
-XX:+UseGCLogFileRotation 
-XX:NumberOfGCLogFiles=9 
-XX:GCLogFileSize=20M 
-XX:+PrintFlagsFinal 
-XX:+PrintFlagsWithComments -version

Solution

  • There is no more -XX:+PrintHeapAtGC and some other Print options since JDK 9.
    The -XX logging flags were replaced with Unified JVM Logging mechanism.

    New equivalent for PrintHeapAtGC is -Xlog:gc+heap=debug