There seems to be a memory leak in the vector_read
function in the python bindings. To reproduce:
# debug_vector_read.py
import gc
import pyxrootd.client
filename = "root://eospublic.cern.ch//eos/opendata/atlas/OutreachDatasets/2020-01-22/4lep/MC/mc_345060.ggH125_ZZ4lep.4lep.root"
def test():
f = pyxrootd.client.File()
res = f.open(filename)
if not res[0]["ok"]:
raise IOError(res)
chunksize = 1024 * 256
chunks = [(i * chunksize, chunksize) for i in range(5)]
res = f.vector_read(chunks)
print(res[0]["message"])
f.close()
for i in range(20):
print(i)
test()
gc.collect()
When running this through memory-profiler with
mprof run debug_vector_read.py
mprof plot
i get this plot:
(Tested with xrootd 5.0.3 from conda-forge)
It seems the problem are these buffers which are never deleted:
Not sure if or when it is allowed to delete them, but if i collect the buffers into an array and delete them after the call to self->file->VectorRead(...)
the memory leak seems to be gone:
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Use REPLY-ALL to reply to list
To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1