forked from OSchip/llvm-project
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:
parent
fe17080c88
commit
6819cf4974
|
@ -157,7 +157,6 @@ static void BackgroundThread(void *arg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 last_flush = NanoTime();
|
u64 last_flush = NanoTime();
|
||||||
u64 last_rss_check = NanoTime();
|
|
||||||
uptr last_rss = 0;
|
uptr last_rss = 0;
|
||||||
for (int i = 0;
|
for (int i = 0;
|
||||||
atomic_load(&ctx->stop_background_thread, memory_order_relaxed) == 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.
|
// 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) {
|
if (flags()->memory_limit_mb > 0) {
|
||||||
last_rss_check = now;
|
|
||||||
uptr rss = GetRSS();
|
uptr rss = GetRSS();
|
||||||
uptr limit = uptr(flags()->memory_limit_mb) << 20;
|
uptr limit = uptr(flags()->memory_limit_mb) << 20;
|
||||||
if (flags()->verbosity > 0) {
|
if (flags()->verbosity > 0) {
|
||||||
|
|
Loading…
Reference in New Issue