Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9275

Memory leak when reading TFolder from file

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • High
    • Resolution: Clarified
    • 6.13/01
    • None
    • I/O
    • None
    • Linux

    Description

      The following code that reads a folder stored in a ROOT file:

      void process_file(const char* fname) {
        TFile rootFile(fname, "READ");
        TFolder *histos_folder;
        rootFile.GetObject("histos", histos_folder);
        rootFile.Close();
       
        // delete histos_folder; // this does not solve the issue
      }
       
      void test() {
        for ( auto &s : { "his05000_Reanalysis_1.root", "his05001_Reanalysis_1.root", "his05002_Reanalysis_1.root" }) {
          process_file(s);
        }
      }

      leads to a memory leak. Explicitly deleting the TFolder object does not make a difference.

      The 3 input data files can be found here:

      https://drive.google.com/open?id=1CUReKcz4v1h1YiwhTLN71XoqqZGLsqV7

      This was reported here:

      https://root-forum.cern.ch/t/pyroot-loop-over-files-huge-memory-leak/28028/3

       

      Attachments

        Activity

          People

            pcanal Philippe Canal
            etejedor Enric Tejedor Saavedra
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: