# Does \`TTree::SetMaxFileSize()\` set the file size limit

**URL:** <https://root-forum.cern.ch/t/does-ttree-setmaxfilesize-set-the-file-size-limit/57094>\
**Category:** ROOT\
**Created:** [November 12, 2023, 2:06am UTC](https://root-forum.cern.ch/t/does-ttree-setmaxfilesize-set-the-file-size-limit/57094 "2023-11-12T02:06:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NgJunKai](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ngjunkai/32/30046_2.png) [@NgJunKai](https://root-forum.cern.ch/u/NgJunKai)\
**Post date:** [November 12, 2023, 2:06am UTC](https://root-forum.cern.ch/t/does-ttree-setmaxfilesize-set-the-file-size-limit/57094/1 "2023-11-12T02:06:21Z")

</div>

I am aware of `TTree::SetMaxFileSize()` because recently i ran into TTree that is \>100GB (i got `Fill: Switching to new file:` followed by a `segmentation fault`). the problem solved when I set the limit \>100GB.

here’s are some related discussions:

> [@Fill: Switching to new file /\*\*\* Break\*\*\* segmentation viola](https://root-forum.cern.ch/t/fill-switching-to-new-file-break-segmentation-viola/8834/5):
>
> Thanks for your expertise. I’ve attached the actual program. To run it I use the command: root -l -b NGenAuAuYt.C’(100000,3.,3.,3.,20,6.,18,.7)’++ \> &! ngenauauyt.out & I have set the file size to 10M so that the maximum is reached right away. However, if the default size of 1.9G is used the result is the same, only it takes longer to fill. [NGenAuAuYt.C](https://root-forum.cern.ch/uploads/default/original/2X/3/30237208d5932060ef90013f8febd44d58651452.C) (19.9 KB)

> [@How to add root files when the target root file is larger than 100 GB](https://root-forum.cern.ch/t/how-to-add-root-files-when-the-target-root-file-is-larger-than-100-gb/37932):
>
> Hello experts, I am trying to add many root files having the same tree name. I am simply using the “hadd” option to add all of them. When the target root file is less than 100 GB, I see no problem. But when the target root file is more than 100 GB, I see that the root is crashing. For example, this is one such crash message: Fill: Switching to new file: ./user.jmaurer.ABp102\_364250.Sherpa\_222\_NNPDF30NNLO\_llll.e5894\_s3126\_r10724\_p3990\_output\_merged\_1.root Fatal in \<TFileMerger::RecursiveRemove\>:…

> [@Root 6.04.14 hadd 100Gb and rootlogon](https://root-forum.cern.ch/t/root-6-04-14-hadd-100gb-and-rootlogon/24581/2):
>
> Indeed hadd does not load the rootlogon file. However you can still manager using the following pattern. Use a source file (let’s called it startup.C) like #include "TTree.h" int startup() { TTree::SetMaxTreeSize( 1000000000000LL ); // 1 TB return 0; } namespace { static int i = startup(); } compile it into a shared library, for example with: root.exe -b -l -q startup.C+ and then use LD\_PRELOAD (DYLD\_INSERT\_LIBRARIES on MacOS) to preload that library: DYLD\_INSERT\_LIBRARIES=startu…

however, i am getting the same error even with the TTree is well below the limit, but the TFile (contain tree and alot of TGraphErrors) is believed to be \>100 GB.

i ‘verified’ the size of the tree by `Print()`:

```auto
******************************************************************************
*Tree :tree : tree *
*Entries : 42089 : Total = 10480384 bytes File Size = 5423795 *
* : : Tree compression factor = 1.93 *
******************************************************************************

```

My question is: does the limit of file is also set by `TTree::SetMaxFileSize()` ?

* * *

\_ROOT Version:6.26.00  
\_Platform:conda (in Ubuntu 20.04, WSL)  
\_Compiler:GCC 10.4.0

* * *

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [November 14, 2023, 2:55pm UTC](https://root-forum.cern.ch/t/does-ttree-setmaxfilesize-set-the-file-size-limit/57094/2 "2023-11-14T14:55:37Z")

</div>

@pcanal should be able to help you on this

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [November 28, 2023, 2:56pm UTC](https://root-forum.cern.ch/t/does-ttree-setmaxfilesize-set-the-file-size-limit/57094/3 "2023-11-28T14:56:30Z")

</div>

Closed on November 28, 2023, 2:56pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
