Arrow Flight memory management
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 94
Description
Hi, everybody,
Recently, I noticed that my Arrow Flight Server keeps a lot of resident memory (hundred of gigabytes) after ingestion of record batches via `DoPut` call.
After debugging I found out that this memory is used in arrow memory pools.
I tried to get memory stats from default and system pools, but it seems that stats are broken:
```
spdlog::info("[Default] Memory usage: peak = {}, allocated = {}", arrow::default_memory_pool()->max_memory(), arrow::default_memory_pool()->bytes_allocated());
spdlog::info("[System] Memory usage: peak = {}, allocated = {}", arrow::system_memory_pool()->max_memory(), arrow::system_memory_pool()->bytes_allocated());
```
The output of these commands always shows 0 for peak and allocated.
However, when I manually call `arrow::default_memory_pool()->ReleaseUnused();` resident memory of the process is freed.
So I have 2 questions
1. Is there any way to control the memory usage of memory pools other than periodically explicitly releasing pools after some idle time?
2. Is there any issue with broken memory pool stats? I didn't find anything related to it in jira.
Thank you in advance.
Arrow version: 6.0.1
Contributor guide
Research direction
Reproduce the report using an Arrow Flight Server's DoPut call on Arrow 6.0.1, then inspect default_memory_pool(), system_memory_pool(), bytes_allocated(), max_memory(), and ReleaseUnused(). Determine why the memory statistics remain zero and document whether pool usage can be controlled without periodic explicit release; done means both questions have a verified explanation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100