Make several HotSpot flags manageable
David Holmes
david.holmes at oracle.com
Sat Feb 7 11:48:53 UTC 2015
Hi Ramki,
On 7/02/2015 12:04 PM, Srinivas Ramakrishna wrote:
> There are a bunch of Hotspot flags (several of them in GC, but also non-GC
> ones) that switch on various printing options.
> These started out historically as product flags but it might make sense to
> make them manageable to allow greater field
> serviceability of the VM in order to manually switch on verbose print
> options for debugging running JVM operation.
> If there is interest, I'd like to open (if one isn't already open) a bug on
> openjdk bugzilla and offer a patch.
Aren't we going to take a performance hit if we do this. The flags,
IIUC, are effectively constants and so when not enabled can be ignored
by the interpreter and by JITed code (but not the runtime). But if they
are manageable then the interpreter and JITed code will have to actually
load and check them on potentially hot paths.
I think you would have to do a detailed performance analysis for each
flag before switching. Flags that only affect the runtime are not a
concern in this aspect of course.
Plus there is the supported interface aspect of this. As per globals.hpp:
// A flag can be made as "manageable" only if
// - the flag is defined in a CCC as an external exported interface.
// - the VM implementation supports dynamic setting of the flag.
// This implies that the VM must *always* query the flag variable
// and not reuse state related to the flag state at any given time.
// - you want the flag to be queried programmatically by the customers.
> A prime example is SafepointDelay and PrintSafepointDelay, but there are a
> whole bunch of more such options, for example,
> the following from a syntactic filter to catch a sample. The idea isn't to
> only touch those flags which control the emission
> of logging/stats from the jvm, not alter its behaviour otherwise in any
> manner.
The idea isn't or is? :)
Cheers,
David
> Is there appetite for this kind of change? In most cases nothing would be
> needed other than to flip the flag from product to
> manageable. In other cases, one would need to make sure to use a
> periodically taken snapshot of the flag to allow cosistency
> in the work done in various routines involved in one "round" of
> logging/stats.
>
> The following is a syntactic sample, and more work would be needed to go
> over these flags and others to determine the specific
> change needed. I plan to do that and produce the patch once there is some
> agreement that this would be a positive step.
>
> Please let me know your thoughts/reactions/comments etc., but it would
> improve HotSpot's field debuggability/serviceability story
> by quite a bit to do this.
>
> thanks, and have a good weekend!
> -- ramki (openjdk: ysr)
>
> % $currentjdk/bin/java -XX:+PrintFlagsFinal -version | grep -v manag | grep
> -i print
>
> bool CMSPrintChunksInDump = false
> {product}
>
> bool CMSPrintEdenSurvivorChunks = false
> {product}
>
> bool CMSPrintObjectsInDump = false
> {product}
>
> bool PrintAdaptiveSizePolicy = false
> {product}
>
> bool PrintCMSInitiationStatistics = false
> {product}
>
> intx PrintCMSStatistics = 0
> {product}
>
> bool PrintCodeCache = false
> {product}
>
> bool PrintCodeCacheOnCompilation = false
> {product}
>
> bool PrintCommandLineFlags = false
> {product}
>
> bool PrintCompilation = false
> {product}
>
> intx PrintFLSCensus = 0
> {product}
>
> intx PrintFLSStatistics = 0
> {product}
>
> bool PrintFlagsFinal := true
> {product}
>
> bool PrintFlagsInitial = false
> {product}
>
> bool PrintGCApplicationConcurrentTime = false
> {product}
>
> bool PrintGCApplicationStoppedTime = false
> {product}
>
> bool PrintGCCause = true
> {product}
>
> bool PrintGCTaskTimeStamps = false
> {product}
>
> bool PrintHeapAtGC = false
> {product rw}
>
> bool PrintHeapAtGCExtended = false
> {product rw}
>
> bool PrintHeapAtSIGBREAK = true
> {product}
>
> bool PrintJNIGCStalls = false
> {product}
>
> bool PrintJNIResolving = false
> {product}
>
> bool PrintOldPLAB = false
> {product}
>
> bool PrintOopAddress = false
> {product}
>
> bool PrintPLAB = false
> {product}
>
> bool PrintParallelOldGCPhaseTimes = false
> {product}
>
> bool PrintPromotionFailure = false
> {product}
>
> bool PrintReferenceGC = false
> {product}
>
> bool PrintSafepointStatistics = false
> {product}
>
> intx PrintSafepointStatisticsCount = 300
> {product}
>
> intx PrintSafepointStatisticsTimeout = -1
> {product}
>
> bool PrintSharedSpaces = false
> {product}
>
> bool PrintStringDeduplicationStatistics = false
> {product}
>
> bool PrintStringTableStatistics = false
> {product}
>
> bool PrintTLAB = false
> {product}
>
> bool PrintTenuringDistribution = false
> {product}
>
> bool PrintTieredEvents = false
> {product}
>
> bool PrintVMOptions = false
> {product}
>
> bool PrintVMQWaitTime = false
> {product}
>
> bool PrintWarnings = true
> {product}
>
> bool ProfilerPrintByteCodeStatistics = false
> {product}
>
>
> I know not all of the following or those above can necessarily be made
> manageable, but this is a possible
>
> starting point for the work/investigation.....
>
> % $currentjdk/bin/java -XX:+PrintFlagsFinal -version | grep -v manag | grep
> -i trace | grep produc
>
> ...
>
> intx BCEATraceLevel = 0
> {product}
>
> bool DTraceAllocProbes = false
> {product}
>
> bool DTraceMethodProbes = false
> {product}
>
> bool DTraceMonitorProbes = false
> {product}
>
> bool ExtendedDTraceProbes = false
> {product}
>
> bool JavaMonitorsInStackTrace = true
> {product}
>
> intx MaxJavaStackTraceDepth = 1024
> {product}
>
> bool OmitStackTraceInFastThrow = true
> {product}
>
> bool StackTraceInThrowable = true
> {product}
>
> bool TraceBiasedLocking = false
> {product}
>
> bool TraceClassLoading = false
> {product rw}
>
> bool TraceClassLoadingPreorder = false
> {product}
>
> bool TraceClassResolution = false
> {product}
>
> bool TraceClassUnloading = false
> {product rw}
>
> bool TraceDynamicGCThreads = false
> {product}
>
> bool TraceGen0Time = false
> {product}
>
> bool TraceGen1Time = false
> {product}
>
> ccstr TraceJVMTI =
> {product}
>
> bool TraceLoaderConstraints = false
> {product rw}
>
> bool TraceMetadataHumongousAllocation = false
> {product}
>
> bool TraceMonitorInflation = false
> {product}
>
> bool TraceParallelOldGCTasks = false
> {product}
>
> intx TraceRedefineClasses = 0
> {product}
>
> bool TraceSafepointCleanupTime = false
> {product}
>
> bool TraceSuspendWaitFailures = false
> {product}
>
More information about the hotspot-dev
mailing list