Commit 8aa81a32 authored by Benoît Lizé's avatar Benoît Lizé Committed by Commit Bot

discardable_memory: Use smaller chunks on Windows 32 bit.

Large chunks are suspected to be the cause for the linked bug (address space
fragmentation). Speculatively use a smaller chunk size to confirm the theory.

Only use a smaller size on Windows 32, as this increases the number of file
descriptors on all platforms, and the underlying issue (address space
fragmentation) is almost impossible on 64 bit architectures, and very unlikely
on Android.

Bug: 983348
Change-Id: Ic3ecc0a37f712be3fa6d45dfb01326b651f3f470
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1915379Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715159}
parent cf755ffa
...@@ -24,13 +24,21 @@ ...@@ -24,13 +24,21 @@
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/memory_dump_manager.h" #include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "components/crash/core/common/crash_key.h" #include "components/crash/core/common/crash_key.h"
namespace discardable_memory { namespace discardable_memory {
namespace { namespace {
// Default allocation size. // Default allocation size.
#if defined(OS_WIN) && defined(ARCH_CPU_32_BITS)
// On Windows 32 bit, use a smaller chunk, as address space fragmentation may
// make a 4MiB allocation impossible to fulfill in the browser process.
// See crbug.com/983348 for details.
const size_t kAllocationSize = 1 * 1024 * 1024;
#else
const size_t kAllocationSize = 4 * 1024 * 1024; const size_t kAllocationSize = 4 * 1024 * 1024;
#endif
// Global atomic to generate unique discardable shared memory IDs. // Global atomic to generate unique discardable shared memory IDs.
base::AtomicSequenceNumber g_next_discardable_shared_memory_id; base::AtomicSequenceNumber g_next_discardable_shared_memory_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment