Loading src/test/e2e/thread_reclaim_test.cpp +8 −1 Changes for src/test/e2e/thread_reclaim_test.cpp: 8 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -41,7 +41,13 @@ static long status_kb(const char* key) { size_t n = strlen(key); char line[256]; while (fgets(line, sizeof line, f)) if (strncmp(line, key, n) == 0) { kb = atol(line + n); break; } if (strncmp(line, key, n) == 0) { /* by hand: atol() here doesn't skip the tab after the key */ const char* c = line + n; while (*c == ' ' || *c == '\t') c++; for (kb = 0; *c >= '0' && *c <= '9'; c++) kb = kb * 10 + (*c - '0'); break; } fclose(f); return kb; } Loading Loading @@ -108,6 +114,7 @@ int main() { int maps1 = count_maps(); long vm1 = status_kb("VmSize:"); long rss1 = status_kb("VmRSS:"); if (getenv("THREAD_RECLAIM_PAUSE")) { printf("pid %d %s\n", getpid(), names[kind]); fflush(stdout); sleep(1); } printf("%s: maps %d -> %d, vm %ld -> %ld kB, rss %ld -> %ld kB\n", names[kind], maps0, maps1, vm0, vm1, rss0, rss1); /* a leaked stack is 16 MB of address space; adjacent leaked Loading Loading
src/test/e2e/thread_reclaim_test.cpp +8 −1 Changes for src/test/e2e/thread_reclaim_test.cpp: 8 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -41,7 +41,13 @@ static long status_kb(const char* key) { size_t n = strlen(key); char line[256]; while (fgets(line, sizeof line, f)) if (strncmp(line, key, n) == 0) { kb = atol(line + n); break; } if (strncmp(line, key, n) == 0) { /* by hand: atol() here doesn't skip the tab after the key */ const char* c = line + n; while (*c == ' ' || *c == '\t') c++; for (kb = 0; *c >= '0' && *c <= '9'; c++) kb = kb * 10 + (*c - '0'); break; } fclose(f); return kb; } Loading Loading @@ -108,6 +114,7 @@ int main() { int maps1 = count_maps(); long vm1 = status_kb("VmSize:"); long rss1 = status_kb("VmRSS:"); if (getenv("THREAD_RECLAIM_PAUSE")) { printf("pid %d %s\n", getpid(), names[kind]); fflush(stdout); sleep(1); } printf("%s: maps %d -> %d, vm %ld -> %ld kB, rss %ld -> %ld kB\n", names[kind], maps0, maps1, vm0, vm1, rss0, rss1); /* a leaked stack is 16 MB of address space; adjacent leaked Loading