Hi,
I want to project a many dimensional sparse histogram to 1 dimensional sparse histo.
While doing this I found a memory leak in my program when calling the Projection function.
I provide with a simple code example to reproduce
void macro() {
Int_t bins[5] = {100,100,100,100,100};
Double_t xmin[5] = {0., 0.,0.,0.,0.};
Double_t xmax[5] = {1.,1.,1.,1.,1.};
auto sp=new THnSparseD("t","t",5,bins,xmin,xmax);
for(auto i=0;i<1000000000;i++)
{
// Double_t a[5]={0.00001*i,0.00001*i,0.00001*i,0.00001*i,0.00001*i};
// sp->Fill(a,1.0);
int b=0;
/* for(auto k=0;k<5;k++)
{
if(k!=b)
{
const auto proj_bin=20;
sp->GetAxis(k)->SetRange(proj_bin,proj_bin);
}
}
sp->GetAxis(b)->SetRange(1,100);*/
const auto hist=sp->Projection(1,&b);
delete hist;
}
}
How can it be that the memory usage grow if I am deleting the object after I create it.
This behavior also happens when projecting to 2 dimensions;
Thank you in advance for any help;
_ROOT Version:6.24/06
_Platform:linuxx8664gcc