代码之家  ›  专栏  ›  技术社区  ›  anotherdave

查找不推荐使用的JVM标志

  •  3
  • anotherdave  · 技术社区  · 6 年前

    我在用电话 java -XX:+PrintFlagsFinal -version 按照 Print all JVM flags 问题,在我升级到JVM 11的路径上比较不同JDK之间的结果。

    PrintFlagsFinal 仍将返回不推荐的选项,例如。 PrintGC 仍然存在,即使正在运行 -XX:+PrintGC 发出警告及;跑 -Xlog:gc 相反

    打印标记最终 我可以使用它来查找当前不推荐使用的所有选项,从而避免使用它们?

    (我知道我可以手动检查发行说明,但是我想知道是否有一种内置的方法可以从JVM中发现,类似于 jdeprscan 不推荐使用的模块依赖项)

    3 回复  |  直到 6 年前
        1
  •  3
  •   apangin    6 年前

    arguments.cpp .

    除了上述类别之外,还有一些不推荐使用的跟踪标志被替换为 Unified JVM Logging 选项。

    arguments.cpp globals*.hpp 家庭我也推荐 VM Options Explorer 具有按版本划分的热点JVM标志结构良好的表的站点。

    从JDK 11开始,已弃用/过时/过期和其他不受支持的标志列表包括:

    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
    

    感谢@chriswhocodes, 虚拟机选项浏览器 现在显示不推荐使用的JVM标志。

        3
  •  1
  •   Henrik Dafgård    6 年前

    如果您可以在应用程序上运行Java飞行记录(例如在开发设置中),并使用Java/JDK任务控制打开它(>=6.0.0)然后JMC将分析用于启动JVM的标志,并告诉您哪些标志已被弃用。

    推荐文章