Skip to content

Commit 4dd2c95

Browse files
Limit the maximum number of opened files in TFileMerger to 128 (#21853)
to mitigate memory consumption issues that may arise during merges with many files Co-authored-by: Lukas Johannes Breitwieser <Lukas Johannes Breitwieser>
1 parent e14d68c commit 4dd2c95

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

io/io/src/TFileMerger.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ static Int_t R__GetSystemMaxOpenedFiles()
7878
}
7979
#endif
8080
if (maxfiles > kClingFileNumber) {
81-
return maxfiles - kClingFileNumber;
81+
// Limit the maximum number of opened files to 128 to mitigate memory
82+
// consumption issues that may arise during merges with many files.
83+
// For further details see analysis at:
84+
// https://github.com/root-project/root/issues/21660
85+
return std::min(128, maxfiles - kClingFileNumber);
8286
} else if (maxfiles > 5) {
8387
return maxfiles - 5;
8488
} else {

0 commit comments

Comments
 (0)