Commit c2720771 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

play around with /proc/status. closes #1239

git-svn-id: file:///svn/toku/tokudb.1195@7682 c7de825b-a66e-492c-adef-691d508d4ae1
parent c96e94ee
......@@ -254,26 +254,19 @@ int main (int argc, const char *argv[]) {
extern void toku_print_trace_mem();
toku_print_trace_mem();
}
#if 0
#if defined __linux__ && __linux__
char fname[256];
sprintf(fname, "/proc/%d/status", getpid());
FILE *f = fopen(fname, "r");
if (f) {
char line[256];
while (fgets(line, sizeof line, f))
while (fgets(line, sizeof line, f)) {
int n;
if (sscanf(line, "VmPeak: %d", &n) || sscanf(line, "VmHWM: %d", &n) || sscanf(line, "VmRSS: %d", &n))
fputs(line, stdout);
fclose(f);
}
{
sprintf(fname, "/proc/%d/statm", getpid());
FILE *f = fopen(fname, "r");
if (f) {
char line[256];
while (fgets(line, sizeof line, f))
fputs(line, stdout);
fclose(f);
}
}
#endif
#endif
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment