[
https://issues.apache.org/jira/browse/ZOOKEEPER-4701?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
zhanglu153 updated ZOOKEEPER-4701:
----------------------------------
Description:
After upgrading from version 3.4.14 to version 3.6.4, it was found that other
JVM memory options (such as - XX: MaxRAMPercentage) cannot be used to control
the memory usage of zookeeper. After investigation, it was found that the
reason was the addition of a default heap size setting of 1000M in the zkEnv.sh
script in version 3.5.
{code:java}
ZK_SERVER_HEAP="${ZK_SERVER_HEAP:-1000}"
export SERVER_JVMFLAGS="-Xmx${ZK_SERVER_HEAP}m $SERVER_JVMFLAGS"{code}
When users use - XX: MaxRAMPercentage to control the memory usage of zookeeper,
it is found that the memory configuration will be overwritten by the default -
Xmx configuration value. This does not meet the memory usage configuration
required by the user.
In [ZOOKEEPER-4391] Unable to use newer JVM memory settings as Xmx overrides -
ASF JIRA (apache.org), newer JVM memory settings cannot be used as Xmx
overrides, and it is also recommended to add a flag to disable memory
configuration behavior by default. This default value can only be selectively
released when the user needs to use the default heap size configuration.
was:
从版本 3.4.14 升级到版本 3.6.4 后,发现其他 JVM 内存选项(如 - XX: MaxRAMPercentage)无法用于控制
zookeeper 的内存使用量。经调查发现,原因是在 3.5 版的 zkEnv.sh 脚本中添加了堆大小的默认设置,默认值为 1000M。
{code:java}
ZK_SERVER_HEAP="${ZK_SERVER_HEAP:-1000}"
export SERVER_JVMFLAGS="-Xmx${ZK_SERVER_HEAP}m $SERVER_JVMFLAGS"{code}
当用户使用 - XX: MaxRAMPercentage 控制 zookeeper 的内存使用量时,发现内存配置会被默认的 - Xmx
配置值覆盖。这不符合用户所需的内存使用配置。
在 ZOOKEEPER-4391 中,无法使用较新的 JVM 内存设置作为 Xmx 覆盖 - ASF JIRA
(apache.org)],还建议添加一个标志以默认禁用内存配置行为。仅当用户需要使用默认堆大小配置时,才能选择性地释放此默认值。
> Unable to use other JVM memory options to control zookeeper memory usage.
> -------------------------------------------------------------------------
>
> Key: ZOOKEEPER-4701
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4701
> Project: ZooKeeper
> Issue Type: Improvement
> Components: scripts
> Affects Versions: 3.5.9, 3.5.10, 3.5.0, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.6.0,
> 3.6.3, 3.7.0, 3.5.5, 3.5.6, 3.5.7, 3.6.1, 3.5.8, 3.6.2, 3.8.0, 3.7.1, 3.6.4,
> 3.8.1
> Reporter: zhanglu153
> Priority: Minor
> Labels: Zookeeper
>
> After upgrading from version 3.4.14 to version 3.6.4, it was found that other
> JVM memory options (such as - XX: MaxRAMPercentage) cannot be used to control
> the memory usage of zookeeper. After investigation, it was found that the
> reason was the addition of a default heap size setting of 1000M in the
> zkEnv.sh script in version 3.5.
> {code:java}
> ZK_SERVER_HEAP="${ZK_SERVER_HEAP:-1000}"
> export SERVER_JVMFLAGS="-Xmx${ZK_SERVER_HEAP}m $SERVER_JVMFLAGS"{code}
> When users use - XX: MaxRAMPercentage to control the memory usage of
> zookeeper, it is found that the memory configuration will be overwritten by
> the default - Xmx configuration value. This does not meet the memory usage
> configuration required by the user.
> In [ZOOKEEPER-4391] Unable to use newer JVM memory settings as Xmx overrides
> - ASF JIRA (apache.org), newer JVM memory settings cannot be used as Xmx
> overrides, and it is also recommended to add a flag to disable memory
> configuration behavior by default. This default value can only be selectively
> released when the user needs to use the default heap size configuration.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)