[sanitizer] Reduce stack depot size on Android.

Summary:
The default setting kTabSizeLog=20 results in an 8Mb global hash table,
almost all of it in private pages. That is not a sane setting in a
mobile, system-wide use case: with ~150 concurrent processes stack
depot will account for more than 1Gb of RAM.

Reviewers: kcc, pcc

Subscribers: srhines, kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D56333

llvm-svn: 350443
This commit is contained in:
Evgeniy Stepanov 2019-01-04 22:55:04 +00:00
parent b5fa0a89b2
commit 9fbc364e16
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ struct StackDepotNode {
u32 tag;
uptr stack[1]; // [size]
static const u32 kTabSizeLog = 20;
static const u32 kTabSizeLog = SANITIZER_ANDROID ? 16 : 20;
// Lower kTabSizeLog bits are equal for all items in one bucket.
// We use these bits to store the per-stack use counter.
static const u32 kUseCountBits = kTabSizeLog;

View File

@ -32,7 +32,7 @@ struct StackDepotHandle {
void inc_use_count_unsafe();
};
const int kStackDepotMaxUseCount = 1U << 20;
const int kStackDepotMaxUseCount = 1U << (SANITIZER_ANDROID ? 16 : 20);
StackDepotStats *StackDepotGetStats();
u32 StackDepotPut(StackTrace stack);