Problem 1787 - Memory leak in RadioactiveDecay
Summary: Memory leak in RadioactiveDecay
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic (show other problems)
Version: other
Hardware: All Linux
: P5 major
Assignee: dennis.herbert.wright
URL:
Depends on:
Blocks:
 
Reported: 2015-09-29 14:34 CEST by jared.strydhorst
Modified: 2015-10-10 02:57 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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);