| Index: base/trace_event/heap_profiler_allocation_register.h
|
| diff --git a/base/trace_event/heap_profiler_allocation_register.h b/base/trace_event/heap_profiler_allocation_register.h
|
| index 873aebfc0cb3ca7a491ecc4a4a0e633bc70b5823..d6a02faeaeaacca487e3ff13d7f71dac34768da1 100644
|
| --- a/base/trace_event/heap_profiler_allocation_register.h
|
| +++ b/base/trace_event/heap_profiler_allocation_register.h
|
| @@ -16,6 +16,7 @@
|
| #include "base/process/process_metrics.h"
|
| #include "base/template_util.h"
|
| #include "base/trace_event/heap_profiler_allocation_context.h"
|
| +#include "build/build_config.h"
|
|
|
| namespace base {
|
| namespace trace_event {
|
| @@ -198,7 +199,9 @@ class FixedHashMap {
|
| // the simplest solution is to just allocate a humongous chunk of address
|
| // space.
|
|
|
| - DCHECK_LT(next_unused_cell_, num_cells_ + 1);
|
| + CHECK_LT(next_unused_cell_, num_cells_ + 1)
|
| + << "Allocation Register hash table has too little capacity. Increase "
|
| + "the capacity to run heap profiler in large sessions.";
|
|
|
| return &cells_[idx];
|
| }
|
| @@ -299,10 +302,16 @@ class BASE_EXPORT AllocationRegister {
|
| private:
|
| friend AllocationRegisterTest;
|
|
|
| - // Expect max 1.5M allocations. Number of buckets is 2^18 for optimal
|
| - // hashing and should be changed together with AddressHasher.
|
| +// Expect lower number of allocations from mobile platforms. Load factor
|
| +// (capacity / bucket count) is kept less than 10 for optimal hashing. The
|
| +// number of buckets should be changed together with AddressHasher.
|
| +#if defined(OS_ANDROID) || defined(OS_IOS)
|
| static const size_t kAllocationBuckets = 1 << 18;
|
| static const size_t kAllocationCapacity = 1500000;
|
| +#else
|
| + static const size_t kAllocationBuckets = 1 << 19;
|
| + static const size_t kAllocationCapacity = 5000000;
|
| +#endif
|
|
|
| // 2^16 works well with BacktraceHasher. When increasing this number make
|
| // sure BacktraceHasher still produces low number of collisions.
|
|
|