How to see RAM/CPU during simulation

Good morning to everybody,

I have a very simple question. Is there a way to see how much RAM/CPU are used (as average) during a Simulation?
Either via linux command (maybe something better than “top”) or by means GEANT4 (maybe it can produce some log file in output which these information are tracked).

Thanks in advance,
Lorenzo

You can get CPU usage information using a G4Timer object. It accumulates CPU and wall clock information between calls to Start() and Stop().

Getting memory usage is difficult at best. This StackOverflow article may be illuminating. Also note that it is “impossible” (read, highly impractical) to separately account for memory used by individual threads.

In addition to the above, which is the native support in Geant4, if you want to see RAM/CPU usage with a separate program, htop is quite popular. For reporting on it from your own program, please take a look at the man page for getrusage(2).

To add one more to the list, there’s prmon

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.