设置环境变量后,Elasticsearch会报告默认的堆内存大小 [英] Elasticsearch reports default heap memory size after setting environment variable

查看:1867
本文介绍了设置环境变量后,Elasticsearch会报告默认的堆内存大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了在Windows框中尝试增加Elasticsearch的JVM堆大小,我定义了以下环境变量:



ES_HEAP_SIZE = 6g



(机器总共有12G RAM)



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



mem:{

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

重新启动后不应该调整其内存大小?

解决方案

运行ES as Windows上的服务


请注意,安装期间可用的环境配置选项将被复制,并将在服务期间使用生命周期。这意味着在安装后对其进行的任何更改都将不会被取消,除非重新安装该服务。


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



然后选择Java选项卡





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




In attempt to increase JVM heap size for Elasticsearch on a Windows box, I defined the following environment variable:

ES_HEAP_SIZE=6g

(The machine has 12G RAM in total).

I have restarted ES and queried its memory usage using _nodes/stat HTTP GET command. However, it seems that it's still using 1GB:

mem: {

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

Shouldn't ES adjust its heap memory size after the restart?

解决方案

From the notes on 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.

If you don't want to uninstall and re-install, you can use the service manager to make the change. Run >service manager

Then select the 'Java' Tab

Change the memory pool settings, hit 'Apply' and restart the service.

这篇关于设置环境变量后,Elasticsearch会报告默认的堆内存大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆