Memory usage of TH1


I’d like to work with histogram collections and have a fairly precise idea of the memory those collections will use. Besides estimating the overhead per TH1 (by looking at the code) + using the number of bins, is there more automatic way to compute the size of a given histogram ?

Something like streaming it and getting the buffer size ? would that work ? If yes, coudl you give an example piece of code ?


sizeof(TH1) + (nbins+2)*(nbytes_per_bin) +name+title_sizes
if you have errors add (nbins+2)*8


Hi Rene,