tsan: query RSS every 100ms

Now that it become faster, it's OK to query it every 100ms again.

llvm-svn: 213943
This commit is contained in:
Dmitry Vyukov 2014-07-25 13:48:25 +00:00
parent fe17080c88
commit 6819cf4974
1 changed files with 1 additions and 3 deletions

View File

@ -157,7 +157,6 @@ static void BackgroundThread(void *arg) {
}
u64 last_flush = NanoTime();
u64 last_rss_check = NanoTime();
uptr last_rss = 0;
for (int i = 0;
atomic_load(&ctx->stop_background_thread, memory_order_relaxed) == 0;
@ -175,8 +174,7 @@ static void BackgroundThread(void *arg) {
}
}
// GetRSS can be expensive on huge programs, so don't do it every 100ms.
if (flags()->memory_limit_mb > 0 && last_rss_check + 1000 * kMs2Ns < now) {
last_rss_check = now;
if (flags()->memory_limit_mb > 0) {
uptr rss = GetRSS();
uptr limit = uptr(flags()->memory_limit_mb) << 20;
if (flags()->verbosity > 0) {