I'm using the java -XX:+PrintFlagsFinal -version
as per the Print all JVM flags question, to compare results between difference JDKs on my upgrade path to JVM 11.
I've noticed though that the result of PrintFlagsFinal
will still return deprecated options — e.g. PrintGC
is still present, even though running -XX:+PrintGC
issues a warning & runs -Xlog:gc
instead.
So is there an option similar to PrintFlagsFinal
that I can use to find all options that are currently deprecated so I can avoid using them?
(Know that I can manually check the release notes, but wondering if there's an in-built way of finding out from the JVM, similar to jdeprscan
for deprecated module dependencies)
There are multiple "levels" of deprecation: ALIASED, DEPRECATED, OBSOLETE and EXPIRED flags with the meaning described in arguments.cpp.
Besides above categories, there are also deprecated tracing flags that are replaced with Unified JVM Logging options.
Finally, there are some flags not listed above that simply have "deprecated" in the description.
I'm not aware of a single place that collects all these deprecated flags together, but it's fairly easy to extract them from JVM sources: the mentioned arguments.cpp and globals*.hpp family. I also recommend VM Options Explorer site with well structured table of HotSpot JVM flags by version.
As of JDK 11, the list of deprecated/obsolete/expired and otherwise unsupported flags includes:
AggressiveOpts
AllowNonVirtualCalls
AssumeMP
CheckAssertionStatusDirectives
CheckEndorsedAndExtDirs
CompilerThreadHintNoPreempt
CreateMinidumpOnCrash
DefaultMaxRAMFraction
DeferPollingPageLoopCount
DeferThrSuspendLoopCount
EnableTracing
FastTLABRefill
FreqCountInvocations
IgnoreUnverifiableClassesDuringDump
InitialRAMFraction
InlineNotify
MaxGCMinorPauseMillis
MaxPermSize
MaxRAMFraction
MinRAMFraction
MonitorInUseLists
MustCallLoadClassInternal
NativeMonitorFlags
NativeMonitorSpinLimit
NativeMonitorTimeout
PermSize
PrintCompressedOopsMode
PrintGC
PrintGCDetails
PrintMalloc
PrintMallocFree
PrintSafepointStatistics
PrintSafepointStatisticsCount
PrintSafepointStatisticsTimeout
PrintSharedSpaces
SafepointSpinBeforeYield
SharedMiscCodeSize
SharedMiscDataSize
SharedReadOnlySize
SharedReadWriteSize
ShowSafepointMsgs
TraceBiasedLocking
TraceClassLoading
TraceClassLoadingPreorder
TraceClassPaths
TraceClassResolution
TraceClassUnloading
TraceExceptions
TraceJVMTIObjectTagging
TraceLoaderConstraints
TraceMonitorInflation
TraceRedefineClasses
TraceSafepointCleanupTime
TraceScavenge
UnlinkSymbolsALot
UnsyncloadClass
UseAppCDS
UseConcMarkSweepGC
UseLockedTracing
UseMembar
UseUTCFileTimestamp
VMThreadHintNoPreempt
UPDATE
Thanks to @chriswhocodes, VM Options Explorer now shows deprecated JVM flags.
I've added deprecation information to the VM Options Explorer at https://chriswhocodes.com/hotspot_option_differences.html
If you can run a Java Flight Recording on the application (e.g. in a development setting) and open it with Java/JDK Mission Control (>= 6.0.0) then JMC will analyze the flags you use to start your JVM and tell you which of them are deprecated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With