# Does "indices.segments.memory\_in\_bytes" in Node stats API show actual memory usage in OS cache?

**URL:** https://discuss.elastic.co/t/does-indices-segments-memory-in-bytes-in-node-stats-api-show-actual-memory-usage-in-os-cache/110979
**Category:** Elasticsearch
**Created:** [December 10, 2017, 6:22pm UTC](https://discuss.elastic.co/t/does-indices-segments-memory-in-bytes-in-node-stats-api-show-actual-memory-usage-in-os-cache/110979 "2017-12-10T18:22:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)
#### Post date: [December 10, 2017, 6:22pm UTC](https://discuss.elastic.co/t/does-indices-segments-memory-in-bytes-in-node-stats-api-show-actual-memory-usage-in-os-cache/110979/1 "2017-12-10T18:22:30Z")

</div>

I would like to ask question about **indices.segments.memory\_in\_bytes** in Node Stats API .

Before asking the question I have read [definitive guide](https://www.elastic.co/guide/en/elasticsearch/guide/current/near-real-time.html#near-real-time) and understood that segments are also exists in OS cache.

In my system, vmstat shows available memory is about **32 GB** (free + buffer + cache) . OS memory is 64GB.

```
2017-12-01 11:05:01 procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
2017-12-01 11:05:01 r b swpd free buff cache si so bi bo in cs us sy id wa st
2017-12-01 11:05:01 19 8 602408 497496 16 31037824 0 0 388 10411 1 0 48 7 41 4 0
2017-12-01 11:06:01 5 0 602396 412732 16 31117308 0 0 2358 161207 31772 56060 44 6 46 4 0
2017-12-01 11:07:01 9 1 602396 2158624 16 29376444 0 0 2241 152205 36625 52261 47 6 42 4 0
2017-12-01 11:08:01 13 10 602380 1612348 16 29921360 8 0 5728 147693 26983 52309 48 6 42 4 0

```

Segments.memory\_in\_bytes shows about 7.6GB.

```
    "segments" : {
      "count" : 4757,
      "memory_in_bytes" : 7654472672,
      "terms_memory_in_bytes" : 5632402110,
      "stored_fields_memory_in_bytes" : 1788182664,
      "term_vectors_memory_in_bytes" : 0,
      "norms_memory_in_bytes" : 306880,
      "points_memory_in_bytes" : 213440590,
      "doc_values_memory_in_bytes" : 20140428,
      "index_writer_memory_in_bytes" : 116584108,
      "version_map_memory_in_bytes" : 5922525,
      "fixed_bit_set_memory_in_bytes" : 10688,
      "max_unsafe_auto_id_timestamp" : 1512086419369,
      "file_sizes" : { }
    },

```

Heap is commited about **32 GB**.

```
  "jvm" : {
    "timestamp" : 1512095101864,
    "uptime_in_millis" : 171846023,
    "mem" : {
      "heap_used_in_bytes" : 16159640384,
      "heap_used_percent" : 50,
      "heap_committed_in_bytes" : 32098877440,

```

Given the fact that segment size in memory is **7.6GB** and heap commited bytes is **32 GB** , I was expecting vmstat to show about **24.4 GB**. But its not.

Total OS memory : 64GB  
Assigned Heap Size : 32 GB  
Segment Size : 7.6GB  
**Available memory : about 24.4 GB**

My question is , is **segment.memory\_in\_bytes** the usage in OS cache?

I appreciate if someone can give me advice.

---

<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: [January 7, 2018, 6:23pm UTC](https://discuss.elastic.co/t/does-indices-segments-memory-in-bytes-in-node-stats-api-show-actual-memory-usage-in-os-cache/110979/2 "2018-01-07T18:23:17Z")

</div>

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