During aggregation and sorting, data are converted to the fielddata structure, which occupies a large amount of memory.
GET /_cat/nodes?v&h=name,fielddataMemory
POST /test/_cache/clear?fielddata=true
In the preceding command, test indicates the name of the index whose fielddata occupies a large amount of memory.
POST /_cache/clear?fielddata=true
The FST structure of each segment is loaded to the memory and will not be cleared. If the number of index segments is too large, the memory usage will be high. You are advised to periodically clear the segments.
GET /_cat/nodes?v&h=segments.count,segments.memory&s=segments.memory:desc
Run the following command on Kibana to clear the cache:
POST /_cache/clear