24 std::ostringstream filename;
25 filename <<
"/proc/" << pid <<
"/status";
27 std::ifstream status(filename.str().c_str());
32 while (!status.eof()) {
34 if (buff ==
"VmSize:")
44#warning MemoryLogger does not yet work on the mac.
52 sl <<
"[ memory usage ] in kB ( VmSize | VmRSS ) : " << mlg.
vmSize() <<
'\t' << mlg.
vmRss();
59 sl <<
"[ memory usage ] in kB ( VmSize | VmRSS ) : " << mlg.
vmSize() <<
'\t' << mlg.
vmRss();
A small helper class looking at /proc/<PID>status.
std::atomic< float > m_rss
real memory size
float vmSize() const
vsize/rss returnal
MemoryLogger()
Default constructor.
std::atomic< float > m_vsize
virtual memory size
void refresh(int pid) const
update the memory logger
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output