简体   繁体   English

如何在weblogic 12c上添加CMS GC调整

[英]how to add CMS GC tuning on weblogic 12c

I understand that weblogic 12C comes with parallel Garbage Collection algorithm. 我了解weblogic 12C带有并行垃圾收集算法。 but how and where to add CMS (concurrent mark-sweep collector, concurrent collector) to my current weblogic 12c. 但是如何以及在何处将CMS(并发标记清除收集器,并发收集器)添加到当前的weblogic 12c中。 Any help is appreciated. 任何帮助表示赞赏。

I found answers from Oracle Document. 我从Oracle文档中找到了答案。 I am pasting here as it going to help other folks. 我要粘贴在这里,因为它会帮助其他人。

Tuning Garbage Collection with Sun JDK When using Sun's JDK, the goal in tuning garbage collection performance is to reduce the time required to perform a full garbage collection cycle. 使用Sun JDK调整垃圾收集使用Sun的JDK时,调整垃圾收集性能的目标是减少执行完整垃圾收集周期所需的时间。 You should not attempt to tune the JVM to minimize the frequency of full garbage collections, because this generally results in an eventual forced garbage collection cycle that may take up to several full seconds to complete. 您不应该尝试调整JVM以最大程度地减少完整垃圾收集的频率,因为这通常会导致最终的强制垃圾收集周期,这可能需要花费整整几秒钟的时间才能完成。

The simplest and most reliable way to achieve short garbage collection times over the lifetime of a production server is to use a fixed heap size with the default collector and the parallel young generation collector, restricting the new generation size to at most one third of the overall heap. 在生产服务器的整个生命周期内实现最短垃圾收集时间的最简单,最可靠的方法是使用具有默认收集器和并行年轻代收集器的固定堆大小,将新一代大小限制为最多总大小的三分之一堆。

The following example JVM settings are recommended for most engine tier servers: 对于大多数引擎层服务器,建议使用以下示例JVM设置:

 -server -Xmx1024m -XX:MaxPermSize=128m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseTLAB -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:CMSIncrementalDutyCycle=10 -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=256 -XX:CMSInitiatingOccupancyFraction=60 -XX:+DisableExplicitGC 

For replica servers, use the example settings: 对于副本服务器,请使用示例设置:

 -server -Xmx3072m -XX:MaxPermSize=128m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseTLAB -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:CMSIncrementalDutyCycle=10 -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=256 -XX:CMSInitiatingOccupancyFraction=60 -XX:+DisableExplicitGC 

The above options have the following effect: 以上选项具有以下效果:

  • -XX:+UseTLAB—Uses thread-local object allocation blocks. -XX:+ UseTLAB-使用线程本地对象分配块。 This improves concurrency by reducing contention on the shared heap lock. 这可以通过减少共享堆锁上的争用来提高并发性。

  • -XX:+UseParNewGC—Uses a parallel version of the young generation copying collector alongside the concurrent mark-and-sweep collector. -XX:+ UseParNewGC-使用并行版本的年轻一代复制收集器以及并发的标记清除扫描收集器。 This minimizes pauses by using all available CPUs in parallel. 通过并行使用所有可用的CPU,可以最大程度地减少暂停时间。 The
    collector is compatible with both the default collector and the 收集器与默认收集器和
    Concurrent Mark and Sweep (CMS) collector. 并发标记和扫描(CMS)收集器。

  • -Xms, -Xmx—Places boundaries on the heap size to increase the predictability of garbage collection. -Xms,-Xmx-在堆大小上放置边界以提高垃圾回收的可预测性。 The heap size is limited in 堆大小限制在
    replica servers so that even Full GCs do not trigger SIP 副本服务器,这样,即使完整GC也不会触发SIP
    retransmissions. 重传。 -Xms sets the starting size to prevent pauses caused by heap expansion. -Xms设置起始大小,以防止由堆扩展引起的暂停。

  • -XX:MaxTenuringThreshold=0—Makes the full NewSize available to every NewGC cycle, and reduces the pause time by not evaluating tenured -XX:MaxTenuringThreshold = 0-使完整的NewSize可用于每个NewGC周期,并通过不评估使用期限来减少暂停时间
    objects. 对象。 Technically, this setting promotes all live objects to the 从技术上讲,此设置会将所有活动对象提升到
    older generation, rather than copying them. 而不是模仿他们。

  • -XX:SurvivorRatio=128—Specifies a high survivor ratio, which goes along with the zero tenuring threshold to ensure that little space is reserved for absent survivors. -XX:SurvivorRatio = 128-指定较高的幸存者比率,该比率与零期限阈值一起使用,以确保为缺席的幸存者保留很少的空间。

You add these to the JVM starting the weblogic servers, this goes into the file startWeblogicServer or startManagedWeblogicServer or setDomainENV 将这些添加到启动weblogic服务器的JVM中,这将进入文件startWeblogicServer或startManagedWeblogicServer或setDomainENV

You will find these in the server/bin directory. 您可以在server / bin目录中找到它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM