- edited description
Event.Summary.memoryUsageMb in the ROOT output is always zero
Offending section, BDSUtilities.cc, line 550:
G4double BDS::GetMemoryUsage()
{
struct rusage r_usage;
G4double result = getrusage(RUSAGE_SELF,&r_usage);
return result;
}
This is because instead of returning the ru_maxrss
attribute of the rusage instance passed by reference, we are simply returning the return code of the getrusage
, which will in general be 0. This was broken in 37d23c3c. However even the old implementation was buggy as it does not work across platforms. On MacOS ru_maxrss
is in unites of bytes, (do man getrusage
on your macbook), whereas according to the linux manual http://man7.org/linux/man-pages/man2/getrusage.2.html, on linux it is in kilobytes. We can detect which OS we’re on with the compiler-provided macros detailed here:
Comments (3)
-
Account Deleted reporter -
Correct! Please fix Stuart as you’ve worked it out.
src/BDSUtilities.hh
already has usage of__APPLE__
in the includes.Thanks,
Laurie
-
- changed status to resolved
Fix Issue
#274.→ <<cset 37e41797ecac>>
- Log in to comment