Problem 711

Summary: Memory Leak in G4NuclearDecay
Product: Geant4 Reporter: d.kruecker
Component: processes/hadronic/modelsAssignee: flei
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 6.2   
Hardware: PC   
OS: Linux   

Description d.kruecker 2005-01-14 06:33:52 CET
There is a memory leak in G4NuclearDecay::DecayIt() if the daughter nucleus is
in an excitate state.
This can be observed in e.g. examples/extended/radioactivedecay/exrdm/
if the ion in the exrdm.in is replace by an isotop where the daughter nucleus
emitts gammas, e.g Y86 (/gps/ion 39 86).
The job increases by about 12MB/100K events.

The problem seems to be at (Geant4.7.0/4.6.2)
G4NuclearDecay.cc line 459:
      dynamicDaughter = new G4DynamicParticle
   (theIonTable->GetIon(daughterZ,daughterA,finalDaughterExcitation),
    daughterMomentum1);
There should be a
 delete dynamicDaughter;
before the pointer is reused.

Best regards,
Dirk Kruecker
Comment 1 d.kruecker 2005-01-17 01:20:59 CET
Sorry,

I truncated the file name.
The correct name is

 G4NuclearDecayChannel.cc

Dirk Kruecker
Comment 2 Hans-Peter.Wellisch 2005-02-22 03:58:59 CET
thank you Dirk, we'll correct it.
Comment 3 flei 2005-03-21 01:54:59 CET
Fixed in tag 'geant4-07-00-ref-02'