ROOT Version: 6.30/02
Platform: Linux Ubuntu 22.04
Compiler: gcc 11.4.0
I am having an issue with a memory leak that appears to be caused by TCanvas::AddExec
. If I run this very simple example:
void dummy_func() {
return;
}
void test_memoryleak(){
TCanvas *c1 = new TCanvas();
TH1D *hist = new TH1D("hist", "hist", 100, 0, 100);
hist->Draw();
c1->AddExec("ex", "dummy_func()");
}
And then watch the memory consumed by ROOT as I move my cursor continuously around the canvas, it slowly creeps up. If I stop moving the cursor, the used memory stays constant. The memory doesn’t seem to be freed, even after calling
c1->DeleteExec("ex");
This eventually causes problems with long interactive sessions where all available memory is used up.