Problem 2567 - reinitializeGeometry causes memory leak?
Summary: reinitializeGeometry causes memory leak?
Status: NEW
Alias: None
Product: Geant4
Classification: Unclassified
Component: run (show other problems)
Version: 11.1
Hardware: All All
: P4 minor
Assignee: Makoto Asai
URL:
Depends on:
Blocks:
 
Reported: 2023-10-20 11:23 CEST by Alvaro Tolosa Delgado
Modified: 2023-10-20 11:45 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Alvaro Tolosa Delgado 2023-10-20 11:23:01 CEST
/run/reinitializeGeometry increase memory usage after every call, I am not sure if that behavior is expected.

The effect can be tested in any example. To reproduce the issue, the /run/reinitializeGeometry command can be placed in a dedicated macro file:

######
# reinit.mac
/run/reinitializeGeometry
######

And then inside the interactive session of any example (B1, B4x), called in a loop:
/control/loop reinit.mac i 0 1000000

And then watch how the memory keeps increasing.

I am not sure if the effect is more critical for more complex geometries than the ones in the examples.
Comment 1 Gabriele Cosmo 2023-10-20 11:37:11 CEST
Have you tried with "/run/reinitializeGeometry true", i.e. instruct to destroy first the old setup?
Comment 2 Alvaro Tolosa Delgado 2023-10-20 11:45:38 CEST
The default value of the parameter is true. I tried "/run/reinitializeGeometry true" but memory kept growing as happened without specifying the parameter.