Configure Elasticsearch Java Virtual Machine (JVM)
Perform the following steps to configure the Elasticsearch Java Virtual Machine (JVM) to use a Heap Size based on the amount of RAM available on the machine:
- Stop the Elasticsearch service.
- OnWindowsenvironment, go toC:\ProgramData\Elastic\Elasticsearch\configdirectory and open the jvm.options file using text editor and edit the following properties:NOTE:The above-mentioned locations are the default locations. If user has customized the directories during installation, then open the jvm.options file from the appropriate directory location.jvm.options File
- By default, the minimum heap size (Xms1g) will be 1 GB and the maximum heap size (Xmx1g) will be 1 GB.
- Edit the minimum heap size (Xms) to half the memory (50% or less) available on the system RAM.
- Edit the maximum heap size (Xmx) to the same value as that of Xms.NOTE:Set the minimum heap size (Xms) and the maximum heap size (Xmx) to the same value. Use the default settings for other properties.
- Save the jvm.options file.
- Start the Elasticsearch service.IMPORTANT:In a Multi-Node Cluster environment, user must set this property to an alternative path.
- To verify that the new values are set to heap size parameters Xms and Xmx, view the Monitoring page or check the Elasticsearch log.
- If the size is not increased perform the following:
- Execute the following command:elasticsearch-service.bat managerRun Elasticsearch Service
- Go to Java and change the sizeJava
Provide Feedback