首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在apache cassandra 3.11.4中启用G1 gc

如何在apache cassandra 3.11.4中启用G1 gc
EN

Stack Overflow用户
提问于 2019-12-16 23:50:42
回答 1查看 1.3K关注 0票数 2

我使用的是apache cassandra 3.11.4和java8,我使用的是48 GB的内存,并且面临着很多gc问题。我想从CMS迁移到G1,并在jvm.options中进行了以下更改,所有CMS changes.Enabled G1都评论道。

代码语言:javascript
运行
复制
### CMS Settings

####-XX:+UseParNewGC
####-XX:+UseConcMarkSweepGC
####-XX:+CMSParallelRemarkEnabled
####-XX:SurvivorRatio=8
####-XX:MaxTenuringThreshold=1
####-XX:CMSInitiatingOccupancyFraction=75
####-XX:+UseCMSInitiatingOccupancyOnly
####-XX:CMSWaitDuration=10000
####-XX:+CMSParallelInitialMarkEnabled
####-XX:+CMSEdenChunksRecordAlways
#### some JVMs will fill up their heap when accessed via JMX, see CASSANDRA-6541
####-XX:+CMSClassUnloadingEnabled

### GC logging options -- uncomment to enable

--XX:+PrintGCDetails
--XX:+PrintGCDateStamps
--XX:+PrintHeapAtGC
--XX:+PrintTenuringDistribution
--XX:+PrintGCApplicationStoppedTime
--XX:+PrintPromotionFailure
--XX:PrintFLSStatistics=1
--Xloggc:/var/log/cassandra/gc.log
--XX:+UseGCLogFileRotation
--XX:NumberOfGCLogFiles=10
--XX:GCLogFileSize=10M

但我要拿到CMS做GC。请建议如何从CNS转换为G1 gc。

EN

Stack Overflow用户

发布于 2019-12-17 00:53:51

这是因为CMS是Java8中的默认垃圾收集器。即使你注释掉它,除非你已经添加了G1设置,否则它仍然会使用CMS。

在CMS和GC日志记录部分之间,该文件中应该还有一个部分- G1部分,如下所示:

代码语言:javascript
运行
复制
### G1 Settings (experimental, comment previous section and uncomment section below to enable)

## Use the Hotspot garbage-first collector.
-XX:+UseG1GC
#
## Have the JVM do less remembered set work during STW, instead
## preferring concurrent GC. Reduces p99.9 latency.
-XX:G1RSetUpdatingPauseTimePercent=5
#
## Main G1GC tunable: lowering the pause target will lower throughput and vise versa.
## 200ms is the JVM default and lowest viable setting
## 1000ms increases throughput. Keep it smaller than the timeouts in cassandra.yaml.
-XX:MaxGCPauseMillis=500

## Optional G1 Settings

# Save CPU time on large (>= 16GB) heaps by delaying region scanning
# until the heap is 70% full. The default in Hotspot 8u40 is 40%.
#-XX:InitiatingHeapOccupancyPercent=70

# For systems with > 8 cores, the default ParallelGCThreads is 5/8 the number of logical cores.
# Otherwise equal to the number of cores when 8 or less.
# Machines with > 10 cores should try setting these to <= full cores.
#-XX:ParallelGCThreads=16
# By default, ConcGCThreads is 1/4 of ParallelGCThreads.
# Setting both to the same value can reduce STW durations.
#-XX:ConcGCThreads=16

如果确保UseG1GCUpdatingPauseTimePercentMaxGCPauseMillis是未注释的,那么Cassandra应该从G1作为垃圾收集器开始。

票数 4
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59360005

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档