I am using root 5.34.26 under windows (VC++12 release). I am trying to read a peculiar root file which has a large number of tress (10708). Each tree in the file has 53 branches of type double and has a friend tree in a secondary file which contains an extra 3 ‘friend’ branches. While doing a recursive read I get a bad_alloc exception after reading 600 to 700 trees (main and friend) or so. As I understand it this exception essentially means that I am running out of memory.
I’ve tried dropping all buffers and baskets and still the issue persists and the only solution that seems to work is deleting the tree pointers once I’ve read the data. Is this the correct way of doing things or am I missing something? Please note that this issue does not occur while reading from a standalone file.
In order to reproduce the issue you may use the following scripts:
[ul]
use the script and set delete_ptr_after_use to false to see the issue : ForumEntryTestRead.cpp (4.74 KB)
standalone file generation script : ForumEntryTestFullWriteNoFriends.cpp (1.83 KB)
main and ‘friend’ file generation script : ForumEntryTestFullWriteHasFriends.cpp (3.31 KB)
[/ul]