Configure Elasticsearch Java Virtual Machine (JVM)

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:
  1. Stop the Elasticsearch service.
  2. On
    Windows
    environment, go to
    C:\ProgramData\Elastic\Elasticsearch\config
    directory 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
  3. By default, the minimum heap size (Xms1g) will be 1 GB and the maximum heap size (Xmx1g) will be 1 GB.
  4. Edit the minimum heap size (Xms) to half the memory (50% or less) available on the system RAM.
  5. 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.
  6. Save the jvm.options file.
  7. Start the Elasticsearch service.
    IMPORTANT:
    In a Multi-Node Cluster environment, user must set this property to an alternative path.
  8. 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:
      1. Execute the following command:
        elasticsearch-service.bat manager
        Run Elasticsearch Service
      2. Go to Java and change the size
        Java
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal