How to measure memory allocated for solid, logical and physical volumes?

Hi everyone,

I want to know how to obtain in Geant4 memory allocation values of created solid, logical and physical volumes.

Thanks and regards,

It is possible to find the ‘instance’ number of the last logical and physical volume which you have created. You can use these, plus an estimate of the memory occupied by a single volume of the type to estimate the amount of memory used.

But the most important memory in most cases is the memory used to store optimisation information used for navigation. You can check in the application developers guide for an explanation of these ‘optimisation voxels’ and how to find out how much memory is used for them.

If you geometry has many volumes at the same level, sharing the same mother, then it is critical to have these optimisation voxels, else the geometry will run very slowly. If the memory used is too much, you can selectively tune the amount - see the details in the guide.