#include <base/memory_consumption.h>
#include <sys/resource.h>
+#include <sys/types.h>
+#include <unistd.h>
#include <iomanip>
+#include <fstream>
+#include <strstream>
LogStream deallog;
utime = diff;
}
}
+
+ static const pid_t id = getpid();
+ std::ostrstream statname;
+ statname << "/proc/" << id << "/stat" << std::ends;
+ static long size;
+ static string dummy;
+ ifstream stat(statname.str());
+ // ignore 22 values
+ stat >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy >>
+ dummy >> dummy >> dummy >> dummy >> dummy >>
+ dummy >> dummy >> dummy >> dummy >> dummy >> dummy >>
+ dummy >> dummy >> dummy >> dummy >> dummy >> size;
const std::string& head = get_prefix();
{
int p = std_out->width(5);
*std_out << utime << ':';
+ std_out->width(16);
+ *std_out << size << ':';
+
std_out->width(p);
}
*std_out << head << ':';
{
int p = file->width(6);
*file << utime << ':';
+ file->width(16);
+ *file << size << ':';
file->width(p);
}
*file << head << ':';