简体   繁体   English

Hazelcast (JVM) memory 设置

[英]Hazelcast (JVM) memory settings

I have installed a cluster of 3 hazelcast nodes.我已经安装了一个包含 3 个 hazelcast 节点的集群。 Each hazelcast node is installed in a dedicated VM (running with centos 7).每个 hazelcast 节点都安装在专用 VM 中(与 centos 7 一起运行)。 Each VM has 16GB RAM and a 15GB HDD.每个 VM 有 16GB RAM 和 15GB HDD。 for each hazelcast node I set the heap memory size in the start.sh script as MIN HEAP SIZE=8G and MAX HEAP SIZE=10G.对于每个 hazelcast 节点,我在 start.sh 脚本中将堆 memory 大小设置为 MIN HEAP SIZE=8G 和 MAX HEAP SIZE=10G。

However, when I monitor the memory usage on the VM, it is not matching the heap memory usage of hazelcast at all.但是,当我监控 VM 上的 memory 使用情况时,它根本不匹配 hazelcast 的堆 memory 使用情况。 Let me give you an example: the VM is showing the memory usage 80%.让我举个例子:VM 显示 memory 使用率为 80%。 however when I check hazelcast heap memory usage it is at 45%.但是,当我检查 hazelcast 堆 memory 的使用情况时,它是 45%。 it is like the VM memory usage is following the higher memory usage of hazelcast.就像 VM memory 使用率遵循榛树的更高 memory 使用率。 then when the GC starts in hazelcast the heap memory usage on hazelcast decreases but the VM memory usage never decreases.然后当 GC 在 hazelcast 中启动时,hazelcast 上的堆 memory 使用量减少,但 VM memory 使用量从未减少。 in the VM I also disable THP and set the swappiness to 10 as mentioned in the performance tuning documentation Performance Tuning (hazelcast.com)在 VM 中,我还禁用 THP 并将 swappiness 设置为 10,如性能调整文档 Performance Tuning (hazelcast.com) 中所述

So is there a missing configuration that I should do for hazelcast?那么我应该为 hazelcast 做的配置是否缺失? What can/should I do?我能/应该做什么?

it is like the VM memory usage is following the higher memory usage of hazelcast.就像 VM memory 使用率遵循榛树的更高 memory 使用率。 then when the GC starts in hazelcast the heap memory usage on hazelcast decreases but the VM memory usage never decreases.然后当 GC 在 hazelcast 中启动时,hazelcast 上的堆 memory 使用量减少,但 VM memory 使用量从未减少。

This is typical behaviour for any JVM application, it is not specific to Hazelcast.这是任何 JVM 应用程序的典型行为,并非特定于 Hazelcast。 By default JVM rarely returns the memory to OS, but it is possible to configure it that way.默认情况下 JVM 很少将 memory 返回给操作系统,但可以这样配置。

See eg this answer for more details on behaviours of particular JVMs.有关特定 JVM 行为的更多详细信息,请参见例如此答案

You say you are using a dedicated VM for Hazelcast.您说您正在为 Hazelcast 使用专用 VM。 In such scenario, it doesn't make sense to return the memory to OS and it is best to use the same MIN and MAX heap size so there is no heap resizing when Hazelcast is running.在这种情况下,将 memory 返回到操作系统是没有意义的,最好使用相同的 MIN 和 MAX 堆大小,以便在 Hazelcast 运行时不会调整堆大小。

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

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