Skip to content

HepMC3DataSource: close the previous reader before reopening - #103

Merged
rahmans1 merged 1 commit into
mainfrom
fix/hepmc3-close-reader-on-reopen
Nov 5, 2026
Merged

rahmans1 merged 1 commit into
mainfrom
fix/hepmc3-close-reader-on-reopen

Conversation

@rahmans1

@rahmans1 rahmans1 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

openNextFile() replaced reader_ without closing it. HepMC3's ReaderRootTree has no destructor, so each dropped reader kept its TFile, TTree and baskets open. A repeating source that wraps often (SYNRAD, ~31 frames per wrap) grew memory by ~11 MB per frame: 13 GB peak at 1000 frames vs 2 GB for SignalBackgroundMerger.

With the old reader closed, peak memory is flat (1.9 GB at 500 frames), and the merged output is unchanged (identical bench summaries vs v0.9.2).

openNextFile() replaced reader_ without closing it. HepMC3's
ReaderRootTree has no destructor, so each dropped reader kept its
TFile, TTree and baskets open. A repeating source that wraps often
(SYNRAD, ~31 frames per wrap) grew memory by ~11 MB per frame:
13 GB peak at 1000 frames vs 2 GB for SignalBackgroundMerger.

With the old reader closed, peak memory is flat (1.9 GB at 500
frames), and the merged output is unchanged (identical bench
summaries vs v0.9.2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rahmans1
rahmans1 requested review from kkauder and simonge November 5, 2026 19:26

@kkauder kkauder left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rahmans1
rahmans1 merged commit 54217b3 into main Nov 5, 2026
1 check passed
@rahmans1
rahmans1 deleted the fix/hepmc3-close-reader-on-reopen branch November 5, 2026 19:32
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

TimeframeBuilder reports for PR #103

Last updated 2026-11-05T16:37-05:00 d8669bd

This branch was previously deployed

1 inactive deployment
github-pages — f8bba311 Deployed Nov 5, 2026 by rahmans1 via deploy-docs #175
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants