00001 #ifndef LEAMEMMONITOR_H 00002 #define LEAMEMMONITOR_H 00003 00004 // 00005 // $Id: LeaMemMonitor.h,v 1.2 2006/06/21 04:19:27 rhatcher Exp $ 00006 // 00007 // functions for inquiring about and printing current memory usage 00008 // Linux specific!!! 00009 // 00011 00012 #include "Rtypes.h" 00013 00014 namespace LeaMemMonitor { 00015 00016 typedef struct memusage { 00017 unsigned int mu_size; // size in bytes (as calculated) 00018 unsigned int mu_sizex; // in human units (as reported) 00019 char mu_sizeu; // unit designation (as reported) 00020 } memusage_t; 00021 00022 typedef struct memstat { 00023 memusage_t ms_total; // total process usage 00024 memusage_t ms_lck; // locked memory 00025 memusage_t ms_rss; // resident shared (RSS) 00026 memusage_t ms_data; // data 00027 memusage_t ms_stk; // stack 00028 memusage_t ms_exe; // executable (code) 00029 memusage_t ms_lib; // library 00030 } memstat_t; 00031 00032 void FillMemStat(LeaMemMonitor::memstat_t& result); 00033 void PrintMemStat(const char* tag=0); 00034 void CalcBytes(memusage_t& usage); 00035 00036 } 00037 00038 #endif // LEAMEMMONITOR_H
1.3.9.1