apache / apache/arrow

[C++] Why is arrow mmap marked MAP_PRIVATE (during read)?

Open
#35,319 5 comments 0 reactions 0 assignees View on GitHub
Component: C++ Status: needs champion Type: usage
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the usage question you have. Please include as many useful details as possible.

Why is it marked MAP_PRIVATE [here](https://github.com/apache/arrow/blob/9009dd76e4e9a2f4f13340ebf4173e71813b359b/cpp/src/arrow/io/file.cc#L449)?
Is there a reason why you've explicitly chosen to not (also) use `MAP_SHARED` similar to write?

We are trying to evaluate if this causes multiple workers (in a distributed training) to `mmap` multiple times instead of reusing the same mmap'ed file and reduce memory usage?

### Component(s)

C++

Contributor guide

Open the contributing guide

Research direction

Read cpp/src/arrow/io/file.cc around line 449 and compare the read mapping flags with the write path. Check the documented MAP_PRIVATE and MAP_SHARED behavior relevant to multiple workers and memory reuse. Done means a maintainer-confirmed explanation of the choice and its implications, with any needed documentation update identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.