# Help needed to understand QuestDB memory usage

**URL:** <https://community.questdb.com/t/help-needed-to-understand-questdb-memory-usage/775>\
**Category:** Community\
**Tags:** question\
**Created:** [March 12, 2025, 6:34pm UTC](https://community.questdb.com/t/help-needed-to-understand-questdb-memory-usage/775 "2025-03-12T18:34:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wxl](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@wxl](https://community.questdb.com/u/wxl)\
**Post date:** [March 12, 2025, 6:34pm UTC](https://community.questdb.com/t/help-needed-to-understand-questdb-memory-usage/775/1 "2025-03-12T18:34:01Z")

</div>

Hi team,

I’m using QuestDB to store and query financial data, but I keep running into the following error:

could not mmap [size=4120, offset=0, fd=606489918049, memUsed=4389914774, fileLen=4120]

This happens during I am running SAMPLE BY query on a minute level data partitioned hourly, and I have 40G+ available for memory and 10G+ for swap. I’m unsure what’s causing the mmap failure or where to focus my troubleshooting.

Any suggestions or pointers would be greatly appreciated, thank you!

---

<div class="post-metadata">

**Author:** ![Vlad\_Ilyushchenko](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.questdb.com/vlad_ilyushchenko/32/339_2.png) [@Vlad\_Ilyushchenko](https://community.questdb.com/u/Vlad_Ilyushchenko)\
**Post date:** [March 13, 2025, 10:27am UTC](https://community.questdb.com/t/help-needed-to-understand-questdb-memory-usage/775/2 "2025-03-13T10:27:29Z")

</div>

hi wxl, we also log OS errno, which usually narrows things down more than error text. That said, have you followed this section of the documentation? [Capacity planning | QuestDB](https://questdb.com/docs/operations/capacity-planning/#os-configuration)
