qwerty
qwerty

Reputation: 3869

Explict GC not being logged

I'm starting a java 1.6.0.32 instance with the following flags

set JAVA_OPTS=%JAVA_OPTS% -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseBiasedLocking -XX:+ExplicitGCInvokesConcurrent
set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDetails
set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCTimeStamps
set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCApplicationStoppedTime
set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCApplicationConcurrentTime
set JAVA_OPTS=%JAVA_OPTS% -Xloggc:gc.log
set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintHeapAtGC
set JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError
set JAVA_OPTS=%JAVA_OPTS% -XX:HeapDumpPath=heap-dump.core
set JAVA_OPTS=%JAVA_OPTS% -server -XX:MaxTenuringThreshold=8 -XX:+CMSIncrementalMode 
set JAVA_OPTS=%JAVA_OPTS% -XX:+CMSIncrementalPacing -XX:+DoEscapeAnalysis 
set JAVA_OPTS=%JAVA_OPTS% -XX:+OptimizeStringConcat
REM set JAVA_OPTS=%JAVA_OPTS% -XX:+UseCompressedOops REM for 64 bit only
set JAVA_OPTS=%JAVA_OPTS% -XX:+UseCompressedStrings -XX:+UseFastAccessorMethods 
set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintTenuringDistribution -XX:+UseStringCache 
set JAVA_OPTS=%JAVA_OPTS% -verbose:gc

I explicitly request for full garbage collection after my app initializes, and wait for it to complete using this technique. I've confirmed that the heap compacts drastically using jvisualvm, but the full GC doesnt seem to be logging in my gc log. I've grepped for "Full GC" with no results. Please note that -XX:+DisableExplicitGC is off. Am I doing anything wrong? Are explicit GC's not logged? Any pointers are deeply appreciated

Upvotes: 1

Views: 313

Answers (2)

Alexey Ragozin
Alexey Ragozin

Reputation: 8399

FullGC is and indication of Stop-the-World mark-sweep-compact collection.

You are using -XX:+ExplicitGCInvokesConcurrent, this flag is telling JVM to use concurrent collection instead of STW when System.gc() is invoked.

You can see log samples of concurrent collector (CMS) in this article.

Upvotes: 1

Peter Lawrey
Peter Lawrey

Reputation: 533720

I always assumed that DisableExplicitGC, disabled explicit GCs so you shouldn't see anything in the logs.

You appear to be busy waiting until something else triggers a GC.

Upvotes: 0

Related Questions