MemorySnooper Class Reference

#include <MemorySnooper.h>

List of all members.

Public Member Functions

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

Private Attributes

int imem


Detailed Description

Definition at line 11 of file MemorySnooper.h.


Constructor & Destructor Documentation

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

Definition at line 13 of file MemorySnooper.h.

References imem, is, pid, deljobs::string, and subSeperate::temp.

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]

Definition at line 34 of file MemorySnooper.h.

References imem.

00034 {return imem;}


Member Data Documentation

int MemorySnooper::imem [private]

Definition at line 36 of file MemorySnooper.h.

Referenced by GetMemorySize(), and MemorySnooper().


Generated on Tue Nov 29 23:20:25 2016 for BOSS_7.0.2 by  doxygen 1.4.7