Optical photons memory swap issue with -DGEANT4_USE_QT=ON

Dear geant4 community,
I ran into an issue using the extended/optical/OpNovice example (or any simulation generating optical photons). My RAM is fully used very fast (8G) and swapping occurs, ultimately the simulation is killed by the sytem. This occurs with only few photons, doing 3 runs on OpNovice is enough to crash the simulation. This is happening on a virtual machine I downloaded from the Bordeaux-Gradignan CENBG website http://geant4.in2p3.fr/spip.php?rubrique8
I did an homemade virtual machine with just geant4 on it and the simulations I do are running fine so it’s not an issue with the code or the macros. Do some of you have any experience running this geant4 virtual machine ? What could cause such an issue with optical photons ? I want to use this virtual machine because I’m a beginner using Linux so a machine with lots of useful softwares cleanly preinstalled would be nice.
Or maybe you know other virtual machines pre-installed with geant4, root, boost, etc… ? Ultimately I want to use geant4 with G4SiPM and generating scintillaton/cerenkov photons.
JB Cizel

If there are many optical photons produced, memory could fill. Try
/tracking/verbose 2
Are there lots of optical photons generated? If so try
/process/optical/cerenkov/setMaxPhotons 1
/process/optical/cerenkov/setTrackSecondariesFirst true
to only generate 1 photon per step, and track it before the primary. (Do the same for scintillation.)

However it sounds like the code works on a different virtual machine. If the problem is specific to a given VM, try changing the title to something like “Memory problem with virtual machine X”.

Hello dsawkey,
Yes the problem is specific. even a few photons are enough. A single photon being reflected inside a LYSO crysal several times uses quite a bunch of RAM. I’ve set 8 Go of RAM on my virtual machine and doing /run/beamOn 10 on the extended/optical/OpNovice example is more than enough to crash the simulator. Doing beamOn 1 I already have 1 Go of used RAM but there is only 90 photons generated. The setTrackSecondariesFirst is true in the OpNovice example and my LYSO simulation.
I’ve changed the titled following your recommendations, thanks.
I’ve also contacted by mail the person in the readme manual on the CENBG virtual machine prior to creating this topic but she didn’t seemed to have an immediate solution for that issue. The geant4 version I use is 10.05.p01.
If someone wants to try it out, you just have to download the virtual machine on the website and run the example you should have the same issue.

Dear all,
I have “resolved” the issue by redoing the geant4 install. The cause is that -DGEANT4_USE_QT=ON. Redoing the exact same install with this one OFF and the optical photon simulations are behaving as expected. Thing is I can’t use the Qt interface anymore. Does someone have an explanation/a fix ? The version is Qt4.