Add support to create memory allocator dump in base::DiscardableMemory
commit3e37155aca48e63f0dcae697de6fd2b9cdf2782a
authorssid <ssid@chromium.org>
Tue, 25 Aug 2015 15:33:20 +0000 (25 08:33 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 25 Aug 2015 15:34:54 +0000 (25 15:34 +0000)
tree896b6ab377256dcbcc13c47acdc1cd8128b35810
parent68c9284f34a247d12327d188d75b81b1b4dd3791
Add support to create memory allocator dump in base::DiscardableMemory

The clients that use discardable memory need to make a memory dump for
tracing. But, the client do not know if the memory is purged or not. So,
discardable manager dumps the live segments and the clients would dump
all the allocations, without the knowledge from the manager. To make the
memory dumps consistent, new api is added to the base::discardable
memory interface to create a memory allocator. this method creates dump
only if the memory is live according to the manager. Note: This still
does not mean that the memory is resident in the system, and the OS
could have purged this discardable segment. This method only helps to
make the memory dumps consistent across all systems. Also, the clients
may not keep track the size of each segment they allocate. So, this api
adds the size when creating the dump. See doc https://goo.gl/AFSTRP.

BUG=503168

Review URL: https://codereview.chromium.org/1306243003

Cr-Commit-Position: refs/heads/master@{#345332}
base/memory/discardable_memory.h
base/test/test_discardable_memory_allocator.cc
components/html_viewer/discardable_memory_allocator.cc
content/child/child_discardable_shared_memory_manager.cc
content/child/child_discardable_shared_memory_manager.h
content/common/discardable_shared_memory_heap.cc
content/common/discardable_shared_memory_heap.h
content/common/discardable_shared_memory_heap_unittest.cc
content/common/host_discardable_shared_memory_manager.cc
gpu/skia_runner/in_process_graphics_system.cc