UnROOT.jl icon indicating copy to clipboard operation
UnROOT.jl copied to clipboard

Opening `km3net_online.root` causes huge memory usage spike

Open Moelf opened this issue 2 years ago • 2 comments

julia> using UnROOT

julia> SAMPLES_DIR="./test/samples/"

julia> function f()
           files = filter(x->endswith(x, ".root"), readdir(SAMPLES_DIR))
           _io = IOBuffer()
           for f in files
               @show f
               r = ROOTFile(joinpath(SAMPLES_DIR, f))
               show(_io, r)
               close(r)
               sleep(1)
           end
       end
f (generic function with 1 method)

julia> f()
f = "Jagged_TLorentzVector.root"
f = "NanoAODv5_sample.root"
f = "TH2_5.root"
f = "TLorentzVector.root"
f = "TNtuple.root"
f = "TNtupleD.root"
f = "TVectorT-double_on_top_level.root"
f = "cms_ntuple_wjet.root"
f = "edm4hep_266.root"
f = "histograms.root"
f = "histograms1d2d.root"
f = "issue108_small.root"
f = "issue116.root"
f = "issue11_tdirectory.root"
f = "issue165.root"
f = "issue165_multiple_baskets.root"
f = "issue246.root"
f = "issue61.root"
f = "issue7.root"
f = "issue87_uncompressed_a.root"
f = "issue87_uncompressed_b.root"
f = "km3net_offline.root"
f = "km3net_online.root"

and watch memory usage, there's a 5-7 GB jump in memory usage when opening up km3net_online, and is causing CI crash on nightly, can you look into this? @tamasgal , for now I'm gonna disable testing the "Display" of this file, since we have plenty other files.

Moelf avatar Aug 02 '23 22:08 Moelf

Oh, this is very weird. km3net_online.root is pretty small, what the heck? I work with such ROOT files on a daily basis.

Looking into this.

tamasgal avatar Aug 08 '23 09:08 tamasgal

I tried your code snippet but I only see an increase from about 400MB to 1100MB when opening the KM3NeT files but it drops down to 400MB again after a few iterations. I guess it's some compilation/GC stuff?

tamasgal avatar Aug 08 '23 09:08 tamasgal