What to do so Elastic Search doesn't consume so much resources?


(Jorge Hernandez) #1

I just wished Elastic Search did not use Java, we have a server running Elastic Search Agent using 75G+ of Virtual Memory and I would like it not to use that much, I know Java is a very hungry Programming Language, but 75G+ of Virtual Memory? --wow--.

I wouldn't complain if this server was the one running the Elastic Search, but this is just the Agent of it.

I hope Elastic does something about this (hopefully stop using Java) because this is not good.


(Mark Walkom) #2

The OS handles that, not Elasticsearch. You will need to look into however your OS can manage/limit that.


(Jorge Hernandez) #3

Not really, this is part of the Java command that opens the Agent, I believe it is the -xms and -Xms arguments that set this up, not the OS.


(Mark Walkom) #4

What's your heap size set to?


(Jorge Hernandez) #5
uintx ErgoHeapSizeLimit                         = 0                                   {product}
uintx HeapSizePerGCThread                       = 87241520                            {product}
uintx InitialHeapSize                          := 2147483648                          {product}
uintx LargePageHeapSizeThreshold                = 134217728                           {product}
uintx MaxHeapSize                              := 32210157568                         {product}

(Mark Walkom) #6

Ok, that looks like it's 32GB? It's just not a format I've seen for configuring Elasticsearch.

However Elasticsearch cannot use memory outside the JVM heap, that's the whole point of defining the limits of it. Anything that is associated with the process that is off heap is managed by the OS.

There's a few good threads in here about this topic, so it might be worth checking some of them out :slight_smile:


(Christian Dahlqvist) #7

Elasticsearch uses some off-heap memory in addition to what has been configured for the heap. It however also relies on the operating system file cache to ensure fast access to commonly used files. This is why it is generally recommended to give 50% of the amount of memory available to Elasticsearch to the heap.

As far as the operating system is concerned memory is there to be used, so the page cache can fill up all the remaining memory. You should however not be concerned about this as it would be released if there was some process that needed it.