-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in k4DataSvc for CaloHitContributions if not explicitly loaded #82
Comments
I think I figured out the underlying problem for this, but I am not yet entirely sure if there is an easy solution to it. The problem is the following: k4FWCore/k4FWCore/src/PodioDataSvc.cpp Lines 70 to 71 in d6555ad
That clears the internal vector of the Given this interplay between the two, I am not sure there is an easy fix. Since overhauling the whole I/O is on our list once we have a prototype of the Frame in podio my preferred solution would actually be to wait until then, unless this is something that cannot be worked around by simply listing all (implicitly) read collections. |
Is there a way to get notified of implicitly read collections as a WARNING? |
I don't think there is an easy way to do that, since implicitly and explicitly read collections go through the same mechanism in the |
I think this should no longer apply with the introduction of Frame based I/O (#100). If this is still an issue, feel free to re-open. |
sim_barrel_sciglass_electron_1.0_10.0.edm4hep.root uploaded to https://drive.google.com/open?id=1-GgZ9EFjEusFOjvTdSoaB2MTNGRndwcN (103 MB, 1000 events with 1-10 GeV electron into EIC SciGlass barrel calorimeter)
We are experiencing a memory leak in the EIC framework which we can reproduce in the key4hep framework as well. We take the same approach to the PodioDataSvc, so that's not very surprising, but I'm reporting it here so someone with expertise in podio can take a look too.
Steps to reproduce
spack install [email protected]
(or e.g. build an environment with [email protected])git clone https://github.com/key4hep/k4-project-template
, build, installcp k4ProjectTemplate/options/readExampleEventData.py k4ProjectTemplate/options/readEICEventData.py
and apply the following changes to read in the collection 'EcalBarrelHits' for all events in an existing file:ddsim
script against the EIC geometry.build
directory, run/usr/bin/time -v ./run k4run ../k4ProjectTemplate/options/readEICEventData.py
.Expected behavior
The value under
Maximum resident set size (kbytes)
should be independent of number of events (and about 500 MB)Actual behavior
The memory use increases with number of events, and goes up to ~2 GB for this file (with 1000 events). Files with more than 10k events are not able to be run on typical systems due to memory limitations.
Workaround
The memory leak can be avoided by explicitly listing the linked collections, i.e. modifying the diff above to
in which case the EcalBarrelHitsContributions collection is properly deleted after each event.
This behavior may qualify as a bug since a data model may change without notice, and downstream options file will continue to work but appear to start leaking memory. It would be clearer if it just failed instead (or didn't leak the memory).
The text was updated successfully, but these errors were encountered: