# What is in Segments Memory?

**URL:** https://discuss.elastic.co/t/what-is-in-segments-memory/61651
**Category:** Elasticsearch
**Created:** [September 28, 2016, 4:22am UTC](https://discuss.elastic.co/t/what-is-in-segments-memory/61651 "2016-09-28T04:22:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Michael\_Sander](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_sander/32/838_2.png) [@Michael\_Sander](https://discuss.elastic.co/u/Michael_Sander)
#### Post date: [September 28, 2016, 4:22am UTC](https://discuss.elastic.co/t/what-is-in-segments-memory/61651/1 "2016-09-28T04:22:29Z")

</div>

###What is in segments memory?

```
GET _stats/?pretty&human
{
 "segments" : {
    "count" : 160,
    "memory" : "24.5gb",
  } ...
   
}

```

I thought segments were stored as files, cached by the OS, and did not reside in ES's heap. However, that does not seem to be the case. The [documentation only says](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-segments.html) that "[s]egments need to store some data into memory in order to be searchable efficiently." What is this "some data"?

---

<div class="post-metadata">

### Author: ![mikemccand](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mikemccand](https://discuss.elastic.co/u/mikemccand)
#### Post date: [September 30, 2016, 6:28am UTC](https://discuss.elastic.co/t/what-is-in-segments-memory/61651/2 "2016-09-30T06:28:42Z")

</div>

There is an in-memory terms index, stored as an FST, that Lucene uses to quickly determine which on-disk block might contain a requested term.

Dimensional points for numeric range filters (coming in 5.0) also has a small in memory tree structure.

Deleted documents bitset (only if there are deletions).

Doc values and stored fields codec formats also have small in-memory structures.

Recent versions of ES break out more details if you pass `&verbose=true` to the Indices Segments API:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-segments.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-segments.html)

Mike McCandless

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 10:15pm UTC](https://discuss.elastic.co/t/what-is-in-segments-memory/61651/3 "2017-07-05T22:15:54Z")

</div>


