What is segments.terms_memory_in_bytes?

I use plugin head to monitor elasticsearch cluster, and I found that the segments.terms_memory_in_bytes occupy most of the memory:

"segments": {
"count": 6813,
"memory_in_bytes": 39858854460,
"terms_memory_in_bytes": 37379779192,
"stored_fields_memory_in_bytes": 2461982384,
"term_vectors_memory_in_bytes": 0,
"norms_memory_in_bytes": 6998592,
"doc_values_memory_in_bytes": 10094292,
"index_writer_memory_in_bytes": 16501940,
"index_writer_max_memory_in_bytes": 7467965004,
"version_map_memory_in_bytes": 137381,
"fixed_bit_set_memory_in_bytes": 0

what is it ? and how to reduce it?

1 Like

That's the heap memory Lucene uses to load the index into the terms dictionary and postings for indexed fields. It's a compact structure (a finite state transducer) so it's suprising yours are taking so much heap.

Do you have many indexed fields? High cardinality indexed fields?

Mike McCandless

yeah, At the first I use the default mapping, and every field will be indexed. can move some of them from heap by myself?

The only way to do that is to stop indexing them.

Mike McCandless

new data will not insert into this index, and this index will be seldom searched. I delete some old data of this index, but the terms_memory_in_bytes is not changed. Why

To see a reduction in the terms heap usage, the segments containing the documents you deleted need to be merged away.

If the indices really will no longer change, you could forceMerge them but this is a costly operation.

Mike McCandless

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.