[MOAB-dev] Measuring memory
Jason Kraftcheck
kraftche at cae.wisc.edu
Wed Jul 28 15:18:17 CDT 2010
On 07/28/2010 02:59 PM, Jason Kraftcheck wrote:
> On 07/28/2010 02:24 PM, Steve Jackson wrote:
>
>> Should this be fixed by changing the if statement to check for data in
>> ru_idrss instead of ru_maxrss? Or would a different approach be
>> preferred?
>
> It is better to prefer the data from /proc/self/stat to that returned from
> getrusage.
Also, it might be temping to use /proc/self/status instead because a) it has
more memory stats and b) the fields are labeled so it is probably more
future-proof. The extra work to parse the data would be worth it. The big
problem with this approach is that other unix-like OSs have radically
different data in that file (e.g. Solaris has binary data corresponding to a
rather large struct.)
- jason
More information about the moab-dev
mailing list