Hi,
We are indexing around 1000 logs per second with the elasticsearch in Client mode. But as soon as we start the product the elasticsearch occupies around 1 GB of the total heap. This however grows > 4 gb in a few mins. We took a heap dump and found the leak suspect show the following.
969,075,752 bytes (45.73 %) of Java heap is used by 39 instances of org/elasticsearch/indices/IndicesService$OldShardsStats
Contains 25 instances of the following leak suspects:
array of org/apache/lucene/index/IndexReaderContext holding 32,745,720 bytes at 0x593493920
array of org/apache/lucene/index/IndexReaderContext holding 31,193,464 bytes at 0x564a167b8
array of org/apache/lucene/index/SegmentReader holding 41,076,960 bytes at 0x564a1bd18
array of org/apache/lucene/index/SegmentReader holding 42,197,240 bytes at 0x57a00e140
array of org/apache/lucene/index/SegmentReader holding 55,882,368 bytes at 0x57f847e78
array of org/apache/lucene/index/SegmentReader holding 51,970,776 bytes at 0x5ae887958
array of org/apache/lucene/index/IndexReaderContext holding 37,529,976 bytes at 0x544983b30
array of org/apache/lucene/index/IndexReaderContext holding 23,545,392 bytes at 0x576e6a478
array of org/apache/lucene/index/IndexReaderContext holding 24,504,016 bytes at 0x5862190f8
array of org/apache/lucene/index/SegmentReader holding 45,007,792 bytes at 0x54529dfb0
array of org/apache/lucene/index/SegmentReader holding 31,010,832 bytes at 0x561789018
array of org/apache/lucene/index/SegmentReader holding 20,942,600 bytes at 0x5ab95c6f0
array of org/apache/lucene/index/IndexReaderContext holding 34,278,344 bytes at 0x5ae887550
array of org/apache/lucene/index/SegmentReader holding 50,109,752 bytes at 0x5624ab938
array of org/apache/lucene/index/IndexReaderContext holding 16,458,112 bytes at 0x54673d7f8
array of org/apache/lucene/index/SegmentReader holding 31,903,696 bytes at 0x592cf0b68
array of org/apache/lucene/index/IndexReaderContext holding 29,125,936 bytes at 0x544fc4318
array of org/apache/lucene/index/IndexReaderContext holding 45,398,144 bytes at 0x54c206ed8
array of org/apache/lucene/index/SegmentReader holding 15,560,120 bytes at 0x5ae7b9930
array of org/apache/lucene/index/IndexReaderContext holding 30,677,160 bytes at 0x55d3b3f48
array of org/apache/lucene/index/IndexReaderContext holding 39,807,240 bytes at 0x55ec255e8
array of org/apache/lucene/index/SegmentReader holding 52,102,584 bytes at 0x5811e7958
array of org/apache/lucene/index/SegmentReader holding 54,997,248 bytes at 0x58215e460
array of org/apache/lucene/index/IndexReaderContext holding 30,658,880 bytes at 0x57a052b88
array of org/apache/lucene/index/SegmentReader holding 34,094,208 bytes at 0x57a44bbf8
Elasticsearch 2.2 is very old and reached the end of its supported life about 18 months ago. More recent versions have seen improvements in how they handle excess load and how well they work with small heaps. Can you reproduce this with a more recent version?
Since our issue is in production. It is would take time to change it to the latest version . So is there any workaround to control the heap growth in the old versions
no we have this problem on most of our servers when the product is running for too long. This also causes the GC to run more than a couple of minutes.
Took another heap dump and found the same issue of memory usage with ES.
Problem Suspect 1
One instance of "org.elasticsearch.transport.TransportService" loaded by "sun.misc.Launcher$AppClassLoader @ 0xf7c7fde8" occupies 665,320,368 (10.34%) bytes. The memory is accumulated in one instance of "java.util.concurrent.ConcurrentHashMap$Node[]" loaded by "<system class loader>" .
I think that sets each new index to have 1 shard, unless you override this when creating the index, and doesn't tell us how many shards there are in total. How many shards does GET _cat/shards list?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.