G4crash ...not enough memory

Hello,

I cough the strange situation… my G4 application crashes due to lack of available memory when I try simulate 10^7 particles. For smaller number it works fine… It is definitely that there is some memory leak.
In debugger I see that it happens at constructor of “G4ParticleHPContAngularPar” when it try “fCache.Put(0);” and it is “id” >39millions. Please see attached screenshot:

Does it normal index value of this class?

Hello,

would it be possible to check if with Geant4 11.2beta (will appears end of June) the problem is still there?

VI

Dear Vladimir,

At present moment I rebuild my application with the latest version of G4 and up to now it works fine when it uses “QGSP_BIC_HP” PhysicsList . Anyway, It require some time to understand situation more clearly.
When I tried to use “QGSP_BIC_AllHP” it crashed due to end of available memory. So, “QGSP_BIC_AllHP” has 100% memory leakage problems in multithreading mode.

Sincerely Yours,
Vyacheslav

Hello all,

Evaluating memory leakage in my G4 application, I have found few suspicions places which eat space…

// ********************************************************************
#ifndef G4AnalysisUtilities_h
#define G4AnalysisUtilities_h 1

// Get short hnType from the tools object
template
G4String GetHnType()
{
// tools::histo::h1d etc.
G4String hnTypeLong = HT::s_class();

// tools::histo::h1d → h1 etc.
return hnTypeLong.substr(14, 2);
}

// ********************************************************************

#ifndef G4ParticleHPList_h
#define G4ParticleHPList_h 1

class G4ParticleHPList
{
public:

G4ParticleHPList()
{
theData = new G4double[2];
nPoints=2;
nEntries=0;
theLabel=0.0;
}
~G4ParticleHPList()
{
delete [] theData;
}
….
// ********************************************************************
#ifndef G4ParticleHPContAngularPar_h
#define G4ParticleHPContAngularPar_h 1


class G4ParticleHPContAngularPar
{

G4ParticleHPContAngularPar(G4ParticleHPContAngularPar & val)
{

theAngular = new G4ParticleHPList[nEnergies];

}

~G4ParticleHPContAngularPar()
{
if (theAngular !=0 ) delete [] theAngular;
if (fCache.Get() != 0) delete fCache.Get();
}

but in the presentation “Improving memory handling in Geant4 MT cache, TLS singletons, garbage collection” A. Dotti (SLAC) it is mentioned that for such code it is recommended to use Simplified “garbage collection”: G4AutoDelete::Register(aData); instead of delete[] in destructors…

Does it a real memory issue or the reality is more complex one than we expect?

Sincerely Yours,
Vyacheslav