TTree error zlib segmentation_violation

Hi rooters,
I have a problem with a TTree object.

I analyze a Tree of data with a program, that produces an output Tree.
When I have a large input Tree ( #entries = 9810735), the program can’t finish the analysis.
At some point, around entry =7.7*10^6, I see this message :

R__unzip: error in inflateInit (zlib)

*** Break *** segmentation violation

*** Break *** segmentation violation
terminate called after throwing an instance of 'std::bad_alloc’
what(): St9bad_alloc

It produces an output file (size=4.0 M) , containing a Tree of analyzed data… but obviously is like a not-closed file.
The name of the output Tree is “h_gam;2” , I don’t understand why there is “2”…

Probably I’ve a memory leak problem.

Thanks in advance.

Dear Tina,

Yes, it looks like you have memory problem.
Can you give more details about the way your code is structured so that we can try to understand where the problem come from?

Gerri Ganis