Uncontrolled memory consumption for synchrotron radiation
Running with ~1k samplers and lots of secondary particles there seems to be an uncontrolled memory consumption. ROOT as the sampler trees are being filled should flush the event from memory to disk, but this does no appear to be happening.
Attached are ILC filed that create the problem
Comments (7)
-
-
-
assigned issue to
-
assigned issue to
-
Hmmm.
Could be in sd class. Should be only one sd class. But only thing that's had big changes recently. Oh and I guess output. Maybe output or analysis manager.
I guess you'll find! Sorry if it was me!
Cheers, Laurie
-
this happens due to secondary photon production in BDSSynchrotronRadiation.cc. Not sure why the secondaries memory is not released after each event again, but there are no memory leaks and can't see anything wrong with the code. Will debug further once Geant4 compilation with debug info is finished.
-
- changed title to Uncontrolled memory consumption for synchrotron radiation
-
fixed in develop branch.
Only half (rounded up) of the secondaries were added to the track. Silly mistake in for-loop:
for(unsigned int n=0;n<listOfSecondaries.size();n++){ aParticleChange.AddSecondary(listOfSecondaries.front()); listOfSecondaries.pop_front(); }
the size of the list (actually a std::deque) decreased in the loop, resulting in only half of the list being accessed.
The not-added secondaries were lost, but somehow this potential memory leak didn't show in valgrind. I guess due to magical Geant4 garbage collection.
-
- changed status to resolved
- Log in to comment
able to reproduce, it happens also without ROOT. Assigning to me.