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

Memory leak when using TTree::Draw on a vector<bool>

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 5.34/00, 6.00.00
    • Fix Version/s: None
    • Component/s: I/O
    • Labels:
      None
    • Environment:

      all

      Description

      Another update. I made an example, creating a TTree with both a vector<int> and a vector<bool> branch containing the same data (takes a little while to run, larger sample makes it easier to see the differences). Next there is one function drawing from the vector<int> and another drawing from the vector<bool>. The macro runs all three sequentially.

      My valgrind etc. knowledge isn't good enough to provide set relevant options and get a useful memory usage printout, but if you open up a memory usage graph, it's easy to visually see the difference between the two drawing functions. This should to the trick:

      root -l macro.C -q

      Hopefully someone has some insights to share...

      And on a side note, if not using the vector<bool> because of this problem, what would be the compactest container alternative?

        Attachments

        1. macro.C
          0.1 kB
        2. mwe.C
          0.8 kB

          Issue Links

            Activity

              People

              • Assignee:
                pcanal Philippe Canal
                Reporter:
                pcanal Philippe Canal
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: