Karthikeyan
Karthikeyan

Reputation: 2001

How can we verify heap size for running ElasticSearch

Am running ElasticSearch Version 6.2.3 and i am increasing heapsize to 4GB in config\jvm.options file. Then am restarting my ES, how i can make sure that my ES is running with my modified heapsize. Is there any command to verify the heap-size of ES.

Am running my ES in Windows machine.

Please find my configuration details.

## JVM configuration

################################################################
## IMPORTANT: JVM heap size
################################################################
##
## You should always set the min and max JVM heap
## size to the same value. For example, to set
## the heap to 4 GB, set:
##
## -Xms2g
## -Xmx2g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
## for more information
##
################################################################

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

-Xms4g
-Xmx4g

Upvotes: 2

Views: 3090

Answers (3)

siddharthlatest
siddharthlatest

Reputation: 2257

You can find out the heap size used by each node using the _cat/nodes endpoint.

It would look like below:

host=localhost:9200 #replace with your Elasticsearch URL
curl $host/_cat/nodes?h=heap*

This would return an output which should look like below:

554.8mb 30 1.8gb
850.9mb 46 1.8gb
  1.7gb 95 1.8gb

Column 1 here is heap.current, aka used heap.
Column 2 here is heap.percent, aka used heap in percentage.
Column 3 here is heap.max, aka max heap available to the node.

The h query string param allows you to select the column names to display. We are using the * wildcard to expand to all the columns that start with the heap prefix.

You can read the documentation here to learn more: https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodes.html.

Upvotes: 9

D.N.
D.N.

Reputation: 2170

You can also check the command line arguments used to launch the instance by using either of the options below:

  1. Use Process Explorer, and hover over the process name for java.exe (launched by elasticsearch.exe). Be sure you have selected "Show Details for All Processes" from the File menu.
  2. Run the following command from an elevated command prompt: WMIC PATH win32_process WHERE "caption='java.exe'" GET Commandline

Both will give you the commandline parameters used to launch the instance. Look for the -Xmx and -Xms values.

For more information about these two options, check out How do I find out command line arguments of a running program?

Upvotes: 0

Mushtu
Mushtu

Reputation: 488

You can find the JVM arguments used in elasticsearch instance in INFO logs. Make sure that your elastic logging level shows INFO logs.

Upvotes: 1

Related Questions