前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >JVM 参数列表

JVM 参数列表

作者头像
邹志全
发布2020-02-25 16:27:34
6560
发布2020-02-25 16:27:34
举报
文章被收录于专栏:EffectiveCodingEffectiveCoding

这一篇说一下JVM 参数相关,首先JVM参数中包含着么几类 标准参数(Standard)、非标准参数(Non-Standard)、高级运行时选项、JIT相关编译高级选项、适用性高级选项、GC相关高级参数、不建议使用的参数(可能会被弃用) 后续会对每个系列的参数还有使用技巧进行详细的剖析,这一篇仅仅是个引导。 但是这个系列,对于不感兴趣的同学可能会无聊至极。不过掌握一些技巧还是蛮有趣的。 懂原理,才能更好的使用嘛~ 其中 标准参数:开头直接为参数名、 非标准参数: -X 开头 高级选项:-XX:开头 后跟+为开启,-为关闭 下面是具体的参数: 大家可以对应这个参数列表对应自己看着感兴趣的看看使用,或者检查一下自己了解哪些。 标准参数(Standard): -agentlib:libname -agentpath:pathname -client -Dproperty=value -d32 -d64 -disableassertions[:[packagename]…|:classname] -da[:[packagename]…|:classname] -disablesystemassertions -dsa -enableassertions[:[packagename]…|:classname] -ea[:[packagename]…|:classname] -enablesystemassertions -esa -help -? -jar filename -javaagent:jarpath[=options] -jre-restrict-search -no-jre-restrict-search -server -showversion -splash:imgname -verbose:class -verbose:gc -verbose:jni -version -version:release 这类标准参数,作用信息非常明确,而且大都有具体的选项。会放在最后介绍。 非标准参数(Non-Standard): -X -XBatch -Xbootclasspath:path -Xbootclasspath/a:path -Xbootclasspath/p:path -Xcheck:jni -Xcomp -Xdebug -Xdiag -Xfuture -Xint -Xinternalversion -Xloggc:filename -Xmaxjitcodesize=size -Xmixed -Xmnsize -Xmssize -Xmxsize -Xnoclassgc -Xprof -Xrs -Xshare:(mode、auto、on、off、dump) -XshowSettings:(category、all、locale、properties、vm) -Xsssize -Xusealtsigs -Xverify:(mode、remote、all、none) 这一块儿会首先说明,因为我们日常用的频次高的大部分是这一片参数

高级运行时选项(Advanced Runtime Options): -XX:+CheckEndorsedAndExtDirs -XX:+DisableAttachMechanism -XX:ErrorFile=filename -XX:+FailOverToOldVerifier -XX:+FilghtRecorder -XX:-FilghtRecorder -XX:FilghtRecorderOptions={ parameter=value、 defaultrecording={true|false}、 disk={true|false}、 dumponexit={true|false}、 dumponexitpath=path、 globalbuffersize=size loglevel={quiet|error|warning|info|debug|trace} maxage=time maxchunksize=size maxsize=size repository=path samplethreads={true|false} settings=path stackdepth=depth threadbuffersize=size } -XX:LargePageSizeInBytes=size -XX:MaxDirectMemorySize=size -XX:NativeMemoryTracking={ mode、off、summary、detail } -XX:ObjectAlignmentInBytes=alignment -XX:OnError=string -XX:OnOutOfMemoryError=string -XX:+PerfDataSaveToFile -XX:+PrintCommandLineFlags -XX:+PrintNMTStatistics -XX:+RelaxAccessControlCheck -XX:+ResourceManagement -XX:ResourceManagementSampleInterval=value (milliseconds) -XX:SharedArchiveFile=path -XX:SharedClassListFile=file_name -XX:+ShowMessageBoxOnError -XX:StartFlightRecording={ parameter=value、 compress={true|false}、 defaultrecording={true|false}、 delay=time、 dumponexit={true|false}、 duration=time、 filename=path、 name=identifier、 maxage=time、 maxsize=size、 settings=path } -XX:ThreadStackSize=size -XX:+TraceClassLoading -XX:+TraceClassLoadingPreorder -XX:+TraceClassResolution -XX:+TraceClassUnloading -XX:+TraceLoaderConstraints -XX:+UnlockCommercialFeatures -XX:+UseAltSigs -XX:+UseAppCDS -XX:-UseBiasedLocking -XX:-UseCompressedOops -XX:+UseHugeTLBFS -XX:+UseLargePages -XX:+UseMembar -XX:+UsePerfData -XX:+UseTransparentHugePages -XX:+AllowUserSignalHandlers

JIT相关编译高级选项 Advanced JIT Compiler Options

-XX:+AggressiveOpts -XX:AllocateInstancePrefetchLines=lines -XX:AllocatePrefetchDistance=size -XX:AllocatePrefetchInstr=instruction -XX:AllocatePrefetchLines=lines -XX:AllocatePrefetchStepSize=size -XX:AllocatePrefetchStyle=style -XX:+BackgroundCompilation -XX:CICompilerCount=threads -XX:CodeCacheMinimumFreeSpace=size -XX:CompileCommand=command,method[,option(break、compileonly、dontinline、exclude、help、inline、log、option、print、quiet)] -XX:CompileCommandFile=filename -XX:CompileOnly=methods -XX:CompileThreshold=invocations -XX:+DoEscapeAnalysis -XX:InitialCodeCacheSize=size -XX:+Inline -XX:InlineSmallCode=size -XX:+LogCompilation -XX:MaxInlineSize=size -XX:MaxNodeLimit=nodes -XX:MaxTrivialSize=size -XX:+OptimizeStringConcat -XX:+PrintAssembly -XX:+PrintCompilation -XX:+PrintInlining -XX:ReservedCodeCacheSize=size -XX:RTMAbortRatio=abort_ratio -XX:RTMRetryCount=number_of_retries -XX:-TieredCompilation -XX:+UseAES -XX:+UseAESIntrinsics -XX:+UseCodeCacheFlushing -XX:+UseCondCardMark -XX:+UseRTMDeopt -XX:+UseRTMLocking -XX:+UseSHA -XX:+UseSHA1Intrinsics -XX:+UseSHA256Intrinsics -XX:+UseSHA512Intrinsics -XX:+UseSuperWord

适用性高级选项 Advanced Serviceability Options -XX:+ExtendedDTraceProbes -XX:+HeapDumpOnOutOfMemory -XX:HeapDumpPath=path -XX:LogFile=path -XX:+PrintClassHistogram -XX:+PrintConcurrentLocks -XX:+UnlockDiagnosticVMOptions

GC相关高级参数 Advanced Garbage Collection Options -XX:+AggressiveHeap -XX:+AlwaysPreTouch -XX:+CMSClassUnloadingEnabled -XX:CMSExpAvgFactor=percent -XX:CMSInitiatingOccupancyFraction=percent -XX:+CMSScavengeBeforeRemark -XX:CMSTriggerRatio=percent -XX:ConcGCThreads=threads -XX:+DisableExplicitGC -XX:+ExplicitGCInvokesConcurrent -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:G1HeapRegionSize=size -XX:+G1PrintHeapRegions -XX:G1ReservePercent=percent -XX:InitialHeapSize=size -XX:InitialSurvivorRatio=ratio -XX:InitiatingHeapOccupancyPercent=percent -XX:MaxGCPauseMillis=time -XX:MaxHeapSize=size -XX:MaxHeapFreeRatio=percent -XX:MaxMetaspaceSize=size -XX:MaxNewSize=size -XX:MaxTenuringThreshold=threshold -XX:MetaspaceSize=size -XX:MinHeapFreeRatio=percent -XX:NewRatio=ratio -XX:NewSize=size -XX:ParallelGCThreads=threads -XX:+ParallelRefProcEnabled -XX:+PrintAdaptiveSizePolicy -XX:+PrintGC -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCTaskTimeStamps -XX:+PrintGCTimeStamps -XX:+PrintStringDeduplicationStatistics -XX:+PrintTenuringDistribution -XX:+ScavengeBeforeFullGC -XX:SoftRefLRUPolicyMSPerMB=time -XX:StringDeduplicationAgeThreshold=threshold -XX:SurvivorRatio=ratio -XX:TargetSurvivorRatio=percent -XX:TLABSize=size -XX:+UseAdaptiveSizePolicy -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseConcMarkSweepGC -XX:+UseG1GC -XX:+UseGCOverheadLimit -XX:+UseNUMA -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:+UseParNewGC -XX:+UseSerialGC -XX:+UseSHM -XX:+UseStringDeduplication -XX:+UseTLAB

不建议使用的参数 Deprecated and Removed Options -Xincgc -Xrunlibname -XX:CMSIncrementalDutyCycle=percent -XX:CMSIncrementalDutyCycleMin=percent -XX:+CMSIncrementalMode -XX:CMSIncrementalOffset=percent -XX:+CMSIncrementalPacing -XX:CMSIncrementalSafetyFactor=percent -XX:CMSInitiatingPermOccupancyFraction=percent -XX:MaxPermSize=size -XX:PermSize=size -XX:+UseSplitVerifier -XX:+UseStringCache

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
应用安全开发
应用安全开发(Application Security Development,下文中也叫 Xcheck)为您提供优质的代码分析服务。Xcheck 凭借优秀的算法和工程实现,能在极低的误报率和漏报率前提下,以极快的速度发现代码中存在的安全漏洞。Xcheck 采用私有化部署的模式,所以产品使用的整个生命周期,源码都不会流出公司网络,杜绝源码泄露风险。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档