39 pageSize = sysconf(_SC_PAGESIZE);
41#warning "Page size query is not possible. No per-process memory stats."
46 std::ostringstream fname;
47 fname <<
"/proc/" << pid <<
"/statm";
48 std::ifstream memFile;
51 memFile.open(fname.str().c_str());
59 while (memFile.good()){
60 memFile.getline(buf, 128);
66 std::istringstream sbuf(buf);
70 long pageKBytes = pageSize / 1024;
71 totalPages = atol(buf);
73 return totalPages * pageKBytes;