Run Time Memory Usage Tool

From ScorecWiki

Jump to: navigation, search

A tool for determining run time memory usage.

phMemSize.cc

phMemSize.h

Example Usage:

 if( rank == 0 ) {
    cout<<"["<<P_pid()<<"] Mem. size before partition: ";
    mem_size=phMemSize(0);
    cout<<"ps -o vsz: "<<mem_size<<" KB, ";
    mem_size=phMemSize(1);
    cout<<"ps -o rss: "<<mem_size<<" KB"<<endl;
 }


VSIZE (Virtual memory SIZE) - The amount of memory the process is currently using. This includes the amount in RAM and the amount in swap.

RSS (Resident Set Size) - The portion of a process that exists in physical memory (RAM). The rest of the program exists in swap. If the computer has not used swap, this number will be equal to VSIZE.

(From the webpage http://mail.nl.linux.org/linux-mm/2003-03/msg00077.html)

Personal tools