Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MemorySnooper Class Reference

#include <MemorySnooper.h>

List of all members.

Public Member Functions

int GetMemorySize () const
int GetMemorySize () const
 MemorySnooper (std::string where)
 MemorySnooper (std::string where)

Private Attributes

int imem


Constructor & Destructor Documentation

MemorySnooper::MemorySnooper std::string  where  )  [inline]
 

00014         {
00015                 int pid=getpid();
00016                 std::ostringstream is;
00017                 is<<pid;
00018                 std::string spid=is.str();
00019                 std::string temp="cat /proc/"+spid+"/status | grep VmSize > mem.txt";
00020                 system(temp.c_str());
00021                 std::ifstream in("mem.txt");
00022                 std::string text,mem,text1;
00023                 in>>text>>mem>>text1;
00024                 system("rm -f mem.txt");
00025                 float memsize=atof(mem.c_str());
00026                 imem=int(memsize);
00027                 std::cout<<"*****************************************************"<<std::endl
00028                          <<"*                                                   *"<<std::endl
00029                          <<"  Memory snooper called here "<<where<<std::endl
00030                          <<"  process size at this point (VmMem): "<<imem<<" kBytes"<<std::endl
00031                          <<"*                                                   *"<<std::endl
00032                          <<"*****************************************************"<<std::endl;
00033         }

MemorySnooper::MemorySnooper std::string  where  )  [inline]
 

00014         {
00015                 int pid=getpid();
00016                 std::ostringstream is;
00017                 is<<pid;
00018                 std::string spid=is.str();
00019                 std::string temp="cat /proc/"+spid+"/status | grep VmSize > mem.txt";
00020                 system(temp.c_str());
00021                 std::ifstream in("mem.txt");
00022                 std::string text,mem,text1;
00023                 in>>text>>mem>>text1;
00024                 system("rm -f mem.txt");
00025                 float memsize=atof(mem.c_str());
00026                 imem=int(memsize);
00027                 std::cout<<"*****************************************************"<<std::endl
00028                          <<"*                                                   *"<<std::endl
00029                          <<"  Memory snooper called here "<<where<<std::endl
00030                          <<"  process size at this point (VmMem): "<<imem<<" kBytes"<<std::endl
00031                          <<"*                                                   *"<<std::endl
00032                          <<"*****************************************************"<<std::endl;
00033         }


Member Function Documentation

int MemorySnooper::GetMemorySize  )  const [inline]
 

00034 {return imem;}

int MemorySnooper::GetMemorySize  )  const [inline]
 

00034 {return imem;}


Member Data Documentation

int MemorySnooper::imem [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:32:00 2011 for BOSS6.5.5 by  doxygen 1.3.9.1