Dear ROOT Experts,
I am trying to optimize my analysis code written in ROOT, and after some profiling, I spotted there is a large memory consumption (~ 50 Mb) immediately after hist->GetXaxis()->SetBinLabel(…) is called.
You can reproduce this by compiling first the following trivial code snippet as a reference:
TProfile *tmp = new TProfile(“tmp”, “tmp”, 1, 0., 1.);
The memory profile is in snapshot_1.
Then, please compile this one:
TProfile *tmp = new TProfile(“tmp”, “tmp”, 1, 0., 1.);
tmp->GetXaxis()->SetBinLabel(1, “a”);
The memory profile for this case is in snapshot_2.
As you can see, there is a dramatic increase of 50 Mb, merely after one bin label is set.
Thanks!
Cheers,
Ante
$ root --version
ROOT Version: 6.32.06
Built for linuxx8664gcc on Apr 03 2025, 03:21:56
From tags/v6-32-06-alice1@v6-32-06-alice1
$ g++ --version
g++ (GCC) 14.2.0