java - 如何将 Cassandra (>2.0) JVM 堆大小设置为 8GB?

标签 java cassandra jvm cassandra-2.0

如何将 Cassandra (>2.0) JVM 堆大小设置为 8GB?当我输入 free -m 时,它会给我以下信息。如何将 Cassandra JVM 堆大小设置为 8GB?

             total       used       free     shared    buffers     cached
Mem:         16047      11336       4711          0         81       5814
-/+ buffers/cache:       5441      10606
Swap:            0          0          0

最佳答案

Tuning Java resources 中所述文档部分:

If you decide to change the Java heap sizing, both MAX_HEAP_SIZE and HEAP_NEWSIZE should should be set together in conf/cassandra-env.sh.

在 cassandra-env.sh 中,搜索这一行:

#MAX_HEAP_SIZE="4G"

代码中的那一行发生在 MAX_HEAP_SIZE 计算发生之后,因此它可以作为覆盖。取消注释,并相应地进行设置。

MAX_HEAP_SIZE="8G"

小心超过 8G。有关调整 JVM 的指导,我推荐 Amy Tobey's Cassandra 2.1 Tuning Guide .她提供了一些调优 CMS 的技巧,以及关于实现新 G1GC 的精彩部分。

关于java - 如何将 Cassandra (>2.0) JVM 堆大小设置为 8GB?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34745419/

相关文章:

java - 使用 google map api 时获取 "peer not authenticated"

java - 如何允许无限对象实例化?

java - JTree 键绑定(bind)

Cassandra 多重获取性能

cassandra 集群不响

azure - 可扩展 Web 应用程序的云与 NoSQL

Android 构建工具 26.0.2 内存不足 (lint)

java - 在 Java 中释放自阻塞引用

java - 添加到数组列表

java - 如果 java.lang.OutOfMemoryError 即将发生,请执行