设置环境变量后 Elasticsearch 报告默认堆内存大小

标签 elasticsearch memory jvm heap-memory

为了在 Windows 机器上增加 Elasticsearch 的 JVM 堆大小,我定义了以下环境变量:

ES_HEAP_SIZE=6g

(机器总共有12G RAM)。

我已经重启了 ES 并使用 _nodes/stat HTTP GET 命令查询了它的内存使用情况。但是,它似乎仍在使用 1GB:

内存:{

heap_used_in_bytes: 1032367576,
heap_used_percent: 99,
heap_committed_in_bytes: 1037959168,
heap_max_in_bytes: 1037959168,
...

重启后ES不应该调整它的堆内存大小吗?

最佳答案

来自 running ES as a service on windows 上的注释:

Note that the environment configuration options available during the installation are copied and will be used during the service lifecycle. This means any changes made to them after the installation will not be picked up unless the service is reinstalled.

如果您不想卸载并重新安装,可以使用服务管理器进行更改。运行>服务管理器

然后选择“Java”选项卡

Java Tab

更改内存池设置,点击“应用”并重新启动服务。

enter image description here

关于设置环境变量后 Elasticsearch 报告默认堆内存大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27128620/

相关文章:

java - 为什么 Oracle 规范没有说明有关元空间的任何信息?

elasticsearch - elasticsearch从0.9.x升级到1.x.x

java - 提高网络抓取效率

elasticsearch - 字段 docs.deleted 在 elasticsearch _cat/indices API 响应中意味着什么?

objective-c - 关于 CATransition 委托(delegate)的内存管理

Java - Java8 中的 JVM 垃圾收集器

multithreading - 确定性执行Java线程,工具支持

php - 如何使用Elasticsearch将过滤器与距离结合起来以进行搜索?

java - 对象构造完成后,是否与其他线程建立了内存栅栏?

c - 在内核中查找未知类型内存的大小