Files
2025-06-06 16:15:07 +08:00

28 lines
440 B
C++

#include "printmemusage.h"
namespace GMapping{
using namespace std;
void printmemusage(){
pid_t pid=getpid();
char procfilename[1000];
sprintf(procfilename, "/proc/%d/status", pid);
ifstream is(procfilename);
string line;
while (is){
is >> line;
if (line=="VmData:"){
is >> line;
cerr << "#VmData:\t" << line << endl;
}
if (line=="VmSize:"){
is >> line;
cerr << "#VmSize:\t" << line << endl;
}
}
}
};