# How to get actual memory (excluding cache/buffer memory) consumed by opensearch process

**URL:** <https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032>\
**Category:** OpenSearch\
**Created:** [April 5, 2025, 6:18am UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032 "2025-04-05T06:18:17Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chirumanem](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@chirumanem](https://forum.opensearch.org/u/chirumanem)\
**Post date:** [April 5, 2025, 6:18am UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032/1 "2025-04-05T06:18:17Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.11.0

**Describe the issue** :  
[Mem used in Bytes from Stats API is showing higher than Kubectl top pods response - OpenSearch - OpenSearch](https://forum.opensearch.org/t/mem-used-in-bytes-from-stats-api-is-showing-higher-than-kubectl-top-pods-response/10107)

It is evident from the discussion above that “used\_in\_bytes” includes buffered/cached memory; nevertheless, whatever stat API allows us to obtain the real memory used by the opensearch process (apart from cache/buffer memory), which ought to be equal to the output of kubectl top pods?

Would you kindly let us know which stat API we should use to verify the actual memory?

Regards,  
Chiranjeevi

**Configuration** :

**Relevant Logs or Screenshots** :

---

<div class="post-metadata">

**Author:** ![chirumanem](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@chirumanem](https://forum.opensearch.org/u/chirumanem)\
**Post date:** [April 8, 2025, 7:46am UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032/2 "2025-04-08T07:46:27Z")

</div>

Hi,  
Any updates on my request.

Regards,  
Chiranjeevi

---

<div class="post-metadata">

**Author:** ![chirumanem](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@chirumanem](https://forum.opensearch.org/u/chirumanem)\
**Post date:** [April 10, 2025, 4:44am UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032/3 "2025-04-10T04:44:19Z")

</div>

Hi,  
Can someone help us on this request, pls.

---

<div class="post-metadata">

**Author:** ![chirumanem](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@chirumanem](https://forum.opensearch.org/u/chirumanem)\
**Post date:** [April 23, 2025, 5:02am UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032/4 "2025-04-23T05:02:28Z")

</div>

Hi,  
Any update on this concern?

---

<div class="post-metadata">

**Author:** ![Eugene7](https://avatars.discourse-cdn.com/v4/letter/e/bbce88/32.png) [@Eugene7](https://forum.opensearch.org/u/Eugene7)\
**Post date:** [April 23, 2025, 2:59pm UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032/5 "2025-04-23T14:59:37Z")

</div>

Hi @chirumanem ,

Please share the output of your stat API request that you are using and `kubectl top pods` in your cluster.

How did you install your OpenSearch cluster? Do you have one container per pod?

---

<div class="post-metadata">

**Author:** ![chirumanem](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@chirumanem](https://forum.opensearch.org/u/chirumanem)\
**Post date:** [April 30, 2025, 12:32pm UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032/6 "2025-04-30T12:32:20Z")

</div>

Hi @Eugene7 ,

Sorry for the late response,  
We are using OpenSearch 2.19.0 in our env and we have 2 data, 3 master and 1 ingest as default.

Kubectl Top Pods Output:

```auto
NAME CPU(cores) MEMORY(bytes)
eric-data-search-engine-data-0 128m 1567Mi
eric-data-search-engine-data-1 149m 1562Mi
eric-data-search-engine-ingest-tls-746d9947d-s8r7n 71m 851Mi
eric-data-search-engine-master-0 75m 856Mi
eric-data-search-engine-master-1 72m 878Mi
eric-data-search-engine-master-2 101m 908Mi

```

Output with " /\_nodes/stats/os?pretty

```auto
eric-data-search-engine-data-0
      "os" : {
        "timestamp" : 1746014475642,
        "cpu" : {
          "percent" : 4,
          "load_average" : {
            "1m" : 1.68,
            "5m" : 2.59,
            "15m" : 2.71
          }
        },
        "mem" : {
          "total_in_bytes" : 2147483648,
          "free_in_bytes" : 105570304,
          "used_in_bytes" : 2041913344,
          "free_percent" : 5,
          "used_percent" : 95
        },
        "swap" : {
          "total_in_bytes" : 0,
          "free_in_bytes" : 0,
          "used_in_bytes" : 0
        },
        "cgroup" : {
          "cpuacct" : {
            "control_group" : "/",
            "usage_nanos" : 3402473240214
          },
          "cpu" : {
            "control_group" : "/",
            "cfs_period_micros" : 100000,
            "cfs_quota_micros" : 50000,
            "stat" : {
              "number_of_elapsed_periods" : 223093,
              "number_of_times_throttled" : 54170,
              "time_throttled_nanos" : 9621001926594
            }
          },
          "memory" : {
            "control_group" : "/",
            "limit_in_bytes" : "2147483648",
            "usage_in_bytes" : "2041913344"
          }
        }
      }

```

As you can see, the stat API displays “used\_percent” of 95, while the kubectl top pods for data-0 display 1567 Mi. This issue was brought up by me a long time ago ( [Mem used in Bytes from Stats API is showing higher than Kubectl top pods response - OpenSearch - OpenSearch](https://forum.opensearch.org/t/mem-used-in-bytes-from-stats-api-is-showing-higher-than-kubectl-top-pods-response/10107) .However, Mr. Radu Gheorghe highlighted at the time that the stat API contains buffer/cache memory, which cannot come up with kubectl top pods command ([Mem used in Bytes from Stats API is showing higher than Kubectl top pods response](https://forum.opensearch.org/t/mem-used-in-bytes-from-stats-api-is-showing-higher-than-kubectl-top-pods-response/10107)).

We now want to know which stat API will provide us with the actual RAM, which ought to resemble the output from kubectl top.

Can you please help me out on this concern?

Regards,  
Chiranjeevi

---

<div class="post-metadata">

**Author:** ![chirumanem](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@chirumanem](https://forum.opensearch.org/u/chirumanem)\
**Post date:** [May 2, 2025, 7:34am UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032/7 "2025-05-02T07:34:51Z")

</div>

Hi @Eugene7 ,

Please let me know on how to check resident memory (actual memory consumed by opensearch i.e. without cache/buffer memory).

Regards,  
Chiranjeevi

---

<div class="post-metadata">

**Author:** ![chirumanem](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@chirumanem](https://forum.opensearch.org/u/chirumanem)\
**Post date:** [May 6, 2025, 5:56am UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032/8 "2025-05-06T05:56:48Z")

</div>

Hi @Eugene7 ,  
Any updates on this concern?

Regards,  
Chiranjeevi

---

<div class="post-metadata">

**Author:** ![chirumanem](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@chirumanem](https://forum.opensearch.org/u/chirumanem)\
**Post date:** [May 12, 2025, 6:04pm UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032/9 "2025-05-12T18:04:26Z")

</div>

Hi,  
Can someone please respond on this concern.

Regards,  
Chiranjeevi

---

<div class="post-metadata">

**Author:** ![chirumanem](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@chirumanem](https://forum.opensearch.org/u/chirumanem)\
**Post date:** [May 29, 2025, 6:39am UTC](https://forum.opensearch.org/t/how-to-get-actual-memory-excluding-cache-buffer-memory-consumed-by-opensearch-process/24032/10 "2025-05-29T06:39:03Z")

</div>

Hi,  
Any updates, please let me know

Regards
