13 {
14 int pid = getpid();
15 std::ostringstream is;
16 is << pid;
17 std::string spid = is.str();
18 std::string temp = "cat /proc/" + spid + "/status | grep VmSize > mem.txt";
19 system( temp.c_str() );
20 std::ifstream in( "mem.txt" );
21 std::string
text, mem, text1;
22 in >>
text >> mem >> text1;
23 system( "rm -f mem.txt" );
24 float memsize = atof( mem.c_str() );
25 imem = int( memsize );
26 std::cout << "*****************************************************" << std::endl
27 << "* *" << std::endl
28 << " Memory snooper called here " << where << std::endl
29 << " process size at this point (VmMem): " << imem << " kBytes" << std::endl
30 << "* *" << std::endl
31 << "*****************************************************" << std::endl;
32 }