Home > Software engineering >  Why is QuestDB using more memory than allocated?
Why is QuestDB using more memory than allocated?

Time:01-10

We've been looking at memory for capacity planning and have a Helm-deployed 8GB-limited QuestDB instance running on one of our k8s clusters.

We recently began scraping metrics off of it. I'm trying to get to the bottom of the questdb_memory_mem_used metric, which occasionally sees excursions way beyond the resource limits.

Chart displaying Memory Used, with peaks of up to almost 25Gb

Does anyone have a good handle on what contributes to this metric and what we could be seeing?

For reference the NATIVE_* tagged metrics seem much more sane in the same time period:

List of several QuestDB monitoring metrics, including FAST_MAP at 789MB and FAST_MAP_LONG_LIST at 6.31GB

CodePudding user response:

According to the documented Prometheus metrics exposed by QuestDB, questdb_memory_mem_used includes all native memory allocations which may include virtual memory if it wasn't touched yet.

This metric includes mmapped files, so that's why its value is that big. You might see that metric grow when you access large tables on your instance. DISTINCT and JOIN queries will also affect this metric.

Please note mmapped memory is elastic and mostly virtual. Only free memory is used for the page cache, so it's fine if this metric has a large value.

  • Related