# How can I check the memory taken by each tree object?

**URL:** <https://root-forum.cern.ch/t/how-can-i-check-the-memory-taken-by-each-tree-object/56780>\
**Category:** Newbie\
**Created:** [October 18, 2023, 4:16pm UTC](https://root-forum.cern.ch/t/how-can-i-check-the-memory-taken-by-each-tree-object/56780 "2023-10-18T16:16:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rushabhgala](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rushabhgala/32/23027_2.png) [@rushabhgala](https://root-forum.cern.ch/u/rushabhgala)\
**Post date:** [October 18, 2023, 4:16pm UTC](https://root-forum.cern.ch/t/how-can-i-check-the-memory-taken-by-each-tree-object/56780/1 "2023-10-18T16:16:44Z")

</div>

* * *

I have a ROOT Tree named MyTree with lots of objects in it Object1, Object2… and a folder with some 2D histograms. How do I check how much memory each object/histogram is using?

_ROOT Version:_ 6.28  
_Platform:_ Ubuntu  
_Compiler:_ Not Provided

Edit : `MyTree->Print()` does it but is there a way to see the information in MB/KB/GB?

* * *

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [October 19, 2023, 6:22am UTC](https://root-forum.cern.ch/t/how-can-i-check-the-memory-taken-by-each-tree-object/56780/2 "2023-10-19T06:22:44Z")

</div>

I guess @pcanal will know

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [October 19, 2023, 9:53pm UTC](https://root-forum.cern.ch/t/how-can-i-check-the-memory-taken-by-each-tree-object/56780/3 "2023-10-19T21:53:25Z")

</div>

> [@rushabhgala](#):
>
> Edit : `MyTree->Print()` does it but is there a way to see the information in MB/KB/GB?
> 
> * * *

For a given `TBranch` the function `TBranch::GetTotalSize` will return the total uncompressed data size for that branch in bytes.
