Skip to content

DPL Analysis: cap the read buffers of the native AOD reader - #16032

Merged
ktf merged 1 commit into
AliceO2Group:devfrom
ktf:pr16032
Nov 3, 2026
Merged

ktf merged 1 commit into
AliceO2Group:devfrom
ktf:pr16032

Conversation

@ktf

@ktf ktf commented Nov 2, 2026

Copy link
Copy Markdown
Member

The native reader fetches the compressed baskets of all the trees a DF is
read from with one coalesced read into one buffer, kept until the DF is
done, and the buffer pool keeps up to two of them for reuse. On Run 2 AO2Ds
(about 62 MB of compressed data per DF) this holds about 75 MB of private
memory per reader for the whole job: IgProf shows the largest allocation of
the reader, 72 MB, in ReadBufferPool::get, and smaps shows it as anonymous
memory, unaffected by fewer threads, no prefetch or MALLOC_ARENA_MAX=1.

--aod-reader-buffer-mb N caps that. The trees of a DF, in the order they
are read, are packed into read plans of at most N MB of compressed data;
a plan is freed when the reads of its trees are done, and the buffer pool
keeps at most N MB of free buffers. A DF which fits is still read in one
go, so small DFs are not affected, and a single tree larger than N gets a
plan of its own. The lookahead for remote files prepares only the trees
which fit. Only the trees the reader asks for are read, as before.

The default is 0, no limit, which keeps the current behaviour until the
default is chosen from measurements.

@ktf
ktf requested a review from a team as a code owner November 2, 2026 08:50
The native reader fetches the compressed baskets of all the trees a DF is
read from with one coalesced read into one buffer, kept until the DF is
done, and the buffer pool keeps up to two of them for reuse. On Run 2 AO2Ds
(about 62 MB of compressed data per DF) this holds about 75 MB of private
memory per reader for the whole job: IgProf shows the largest allocation of
the reader, 72 MB, in ReadBufferPool::get, and smaps shows it as anonymous
memory, unaffected by fewer threads, no prefetch or MALLOC_ARENA_MAX=1.

--aod-reader-buffer-mb N caps that. The trees of a DF, in the order they
are read, are packed into read plans of at most N MB of compressed data;
a plan is freed when the reads of its trees are done, and the buffer pool
keeps at most N MB of free buffers. A DF which fits is still read in one
go, so small DFs are not affected, and a single tree larger than N gets a
plan of its own. The lookahead for remote files prepares only the trees
which fit. Only the trees the reader asks for are read, as before.

The default is 0, no limit, which keeps the current behaviour until the
default is chosen from measurements.
@ktf
ktf merged commit d7ded9d into AliceO2Group:dev Nov 3, 2026
16 checks passed
@ktf

ktf commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Tested on hyperloop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant