Problem 1787

Summary: Memory leak in RadioactiveDecay
Product: Geant4 Reporter: jared.strydhorst
Component: processes/hadronicAssignee: dennis.herbert.wright
Status: RESOLVED FIXED    
Severity: major    
Priority: P5    
Version: other   
Hardware: All   
OS: Linux   

Description jared.strydhorst 2015-09-29 14:34:09 CEST
There seems to a memory leak in the radioactive decay process of version 10.2 beta. Running a simulation with a radioactive ion source consumes more and more memory the longer it runs. The problem may be related to the PhotonEvaporation. The problem seems more severe with more complicated deexcitation schemes, and seems to not exist at all for isotopes that always decay to the ground state of the daughter nucleus.
Comment 1 dennis.herbert.wright 2015-10-10 02:57:54 CEST
Thanks for reporting this.

The leaks were in G4ITDecay.cc and have been fixed.  The fix will appear in the 10.2 release of Geant4.  

If you want to fix it in your copy, you can edit the code 
geant4/source/processes/hadronic/models/radioactive_decay/src/G4ITDecay.cc

by inserting the line
  delete nucleus;

after lines 100 and 101,

  G4DynamicParticle* dynDaughter = new G4DynamicParticle(daughterIon,
                                                         daughterMomentum);
 

and inserting the line 
  delete eOrGamma;


after line 109 (new line number) 
    products->PushProducts(eOrGammaDyn);