[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
Environment:

all


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

 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?



 Comments   
Comment by Philippe Canal [ 23/Sep/13 ]

Hi,

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

Cheers,
Philippe

Generated at Sun Sep 22 01:33:47 CEST 2019 using Jira 7.13.1#713001-sha1:5e06076c2d215a6f699b7e5c90ab2fae7ba5a1ce.