# About FDB memory usage

**URL:** <https://forums.foundationdb.org/t/about-fdb-memory-usage/4534>\
**Category:** Using FoundationDB\
**Created:** [June 26, 2024, 6:59am UTC](https://forums.foundationdb.org/t/about-fdb-memory-usage/4534 "2024-06-26T06:59:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gripleaf](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/gripleaf/32/1642_2.png) [@gripleaf](https://forums.foundationdb.org/u/gripleaf)\
**Post date:** [June 26, 2024, 6:59am UTC](https://forums.foundationdb.org/t/about-fdb-memory-usage/4534/1 "2024-06-26T06:59:50Z")

</div>

FoundationDB Version: 7.1.44

For `ssd-2` storage engine, my storage server memory usage upper to 7GB. However, I use all default configurations.

 ![image](https://global.discourse-cdn.com/foundationdb/original/2X/d/d58940eaa03b68e7704aafa7d1ccc75dac7e76a7.png)

According to [configuration.html#fdbserver-section](https://apple.github.io/foundationdb/configuration.html#fdbserver-section), It should only use about 4GB RAM.

So, I want to know where the memory is used?

1. cache\_memory used 2GB.
2. STORAGE\_HARD\_LIMIT\_BYTES used 1.5GB (however, my storage queue size should be almost empty, because I didn’t write many at above time).
3. in-memory status used few hundreds MB?

So, who may use the another 3.5GB~5GB RAM? There is any way to figure out the memory usage?

My purpose is to avoid oom kill, it would cause cache miss. And I also want to cache as more as possible data in memory to increase throughput.

---

<div class="post-metadata">

**Author:** ![johscheuer](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@johscheuer](https://forums.foundationdb.org/u/johscheuer)\
**Post date:** [June 26, 2024, 8:25am UTC](https://forums.foundationdb.org/t/about-fdb-memory-usage/4534/2 "2024-06-26T08:25:40Z")

</div>

> According to [configuration.html#fdbserver-section](https://apple.github.io/foundationdb/configuration.html#fdbserver-section), It should only use about 4GB RAM.

The default value for the `memory` setting is 8GiB not 4GiB:

> `memory` : Maximum resident memory used by the process. The default value is 8GiB. When specified without a unit, MiB is assumed.

> So, who may use the another 3.5GB~5GB RAM? There is any way to figure out the memory usage?

You could look at the following logs: `Type="MemoryMetrics"` and `Type="ProcessMetrics" ` to get a better idea and probably `Type="StorageMetrics"`.

---

<div class="post-metadata">

**Author:** ![gripleaf](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/gripleaf/32/1642_2.png) [@gripleaf](https://forums.foundationdb.org/u/gripleaf)\
**Post date:** [June 26, 2024, 9:43am UTC](https://forums.foundationdb.org/t/about-fdb-memory-usage/4534/3 "2024-06-26T09:43:13Z")

</div>

> [@johscheuer](#):
>
> The default value for the `memory` setting is 8GiB not 4GiB:

> The default value of 8GiB is double the intended memory usage in the default configuration (providing an emergency buffer to deal with memory leaks or similar problems).

So, I think the memory should be a little more than 4GB at most.
