NUISANCEMC / nuisance

github mirror of the NUISANCE neutrino interaction generator comparison tool. Compare your favourite neutrino interaction generators to each other and over 350 published data sets
https://nuisance.hepforge.org
GNU General Public License v3.0
11 stars 21 forks source link

Memory leak when looping over NEUT events #65

Open KSkwarczynski opened 1 month ago

KSkwarczynski commented 1 month ago

Description

It is rouglhy 400 MB for every 50/100 reconfigures, as we go pace increases. This is annoing espeically when running longer fits...

How to reproduce

Take this badboi docker pull picker24/pittpaccbox and run this code

#include "FitLogger.h"
#include "PlotUtils.h"
#include "StatUtils.h"
#include "TFile.h"
#include "TH1D.h"
#include "TTree.h"
#include <stdio.h>
#include <stdlib.h>

// If you don't have NEUT enabled, you shouldn't compile this...
#include "neutpart.h"
#include "neutvect.h"
#include "NEUTInputHandler.h"

//*******************************
int main(int argc, char *argv[]) {
//*******************************

  NEUTInputHandler* input = new NEUTInputHandler("Luke", "/hosthome/Pittpac/T2K_NEUT_Short.root");

  int iterator = 0;
  while(true)
  {
    for (int i = 0; i < input->GetNEvents(); i++)
    {
      input->GetNuisanceEvent(i, true);
    }
    //if (iterator % (100) == 0)
    std::cout<<"Luke help "<<iterator<<std::endl;
    iterator++;
  }

};