[ROOT-5539] Memory leak when using TTree::Draw on a vector<bool> Created: 22/Sep/13  Updated: 23/Oct/18  Resolved: 23/Sep/13

Status: Closed
Project: ROOT
Component/s: I/O
Affects Version/s: 5.34/00, 6.00.00
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Philippe Canal Assignee: Philippe Canal
Resolution: Fixed Votes: 0
Labels: None


Attachments: File macro.C     File mwe.C    
Issue Links:
is duplicated by ROOT-5959 memory leak in TStreamerInfoActions::... Closed
External issue URL: http://root.cern.ch/phpBB3/viewtopic.php?t=16990


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?

Comment by Philippe Canal [ 23/Sep/13 ]


Thanks for reporting this issue. It has been fixed in the v5.34 patch branch and the v6 trunk.


Generated at Mon Feb 24 16:58:29 CET 2020 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.