Message: Re: memory leak using G4GammaNuclearReaction in G4.9.1 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: memory leak using G4GammaNuclearReaction in G4.9.1 

Forum: Physics List
Re: Question memory leak using G4GammaNuclearReaction in G4.9.1 (Alfred Tang)
Date: 01 Mar, 2008
From: Vladimir IVANTCHENKO <>

On Thu, 28 Feb 2008, Alfred Tang wrote:

> *** Discussion title: Physics List
> Email replies to must include:
>   In-Reply-To: <"/phys-list/460">
>   Subject: ...change this to be about your reply.
> I am trying simulate muon-induced produciton of neutrons in a liquid scintillator
> detector.  As a start, I have the following lines in my PhysicsList:
>     G4String particleName = particle->GetParticleName();
>     if (particleName == "gamma") {
>       //low energy part
>       G4GammaNuclearReaction* lowEGammaModel = new G4GammaNuclearReaction();
>       lowEGammaModel->SetMaxEnergy(3.5*GeV);
>       //photonuclear process
>       G4PhotoNuclearProcess* photoProc = new G4PhotoNuclearProcess();
>       photoProc->RegisterMe(lowEGammaModel);
>       pmanager->AddDiscreteProcess(photoProc);
>     }
> But when I run this code using Geant4.9.1 or Geant4.9.1.p01, it seems to have
> a memory leak because I can see that RAM memory is quickly used up and then the
> swap disk is also soon filled up before the program crashes.  I did not have
> this problem before when I was running Geant4.9.0.  As far as I know, I only
> see this problem in Geant4.9.1 and Geant4.9.p01.  Can anyone tell me what is wrong?
> How do I fix the problem?  Thanks.


First, it may be useful to rebuild Geant4 9.1p01 and your application from
scratch in order to avoid problems with abnormal links. In our tests there
no significant leaks both for 9.1 and 9.1p01, however after initialisation
and few first events the memory should grow but this grows is limited.

Second, better to use one of existing physics lists, for example, 
QGSP_BERT, which by default has muon-nuclear interactions active.

Third, using Valgrind tool it is possible to identify exact source of the 


Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "Re: memory leak using G4GammaNuclearReaction in G4.9.1"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]