Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Issue 1531463004: [tracing]Fix resident size of malloc for mac and ios. (Closed)

Created:
5 years ago by ssid
Modified:
5 years ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[tracing]Fix resident size of malloc for mac and ios. The default system allocator works with 4 allocation regions: tiny, small, large and huge. The tiny and small region allocates large vm regions (1-8Mb) and for each allocation the first continuous chunk that fits the allocation size is returned. "max_size_in_use" gives the sum of sizes of the regions without the last chunk that is untouched. So, any region in this range should either be in use or was in use in the past and freed. This would mean that this memory is resident (% the memory that client allocated and not touched). The large and huge regions maintain the hash table of exact allocation sizes. So, "max_size_in_use" is the sum of allocated objects size, which should be resident. For a 32 bit sytsem, each allocation below 496 bytes(tiny) is rounded to 16 bytes and each allocation below 47Mb(small) is rounded to 512 bytes. Allocations larger than that are rounded to system page size. This would cause the "max_size_in_use" to be more than the actual resident size. But this is the closest approximation to resident size and on experiments showed that the value at most 4% more than the actual resident size. The malloc dumps used to show resident size and allocated objects size. It is hard to understand why is there a difference. This CL adds an extra dump to specify what is that memory used for. This CL also rearranges the #if conditions so that in future tcmalloc is used in mac, it still shows correct values. BUG=542584 Committed: https://crrev.com/86f78c1c70715d6f43ab59fa6cc51be4c1dc7774 Cr-Commit-Position: refs/heads/master@{#366366}

Patch Set 1 #

Patch Set 2 : Additions. #

Total comments: 4

Patch Set 3 : fix comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -7 lines) Patch
M base/trace_event/malloc_dump_provider.cc View 1 2 3 chunks +24 lines, -7 lines 0 comments Download

Messages

Total messages: 18 (10 generated)
ssid
5 years ago (2015-12-16 12:24:59 UTC) #3
Primiano Tucci (use gerrit)
LGTM.thanks for the explanation https://codereview.chromium.org/1531463004/diff/20001/base/trace_event/malloc_dump_provider.cc File base/trace_event/malloc_dump_provider.cc (right): https://codereview.chromium.org/1531463004/diff/20001/base/trace_event/malloc_dump_provider.cc#newcode56 base/trace_event/malloc_dump_provider.cc:56: // the whole region other ...
5 years ago (2015-12-18 14:54:24 UTC) #5
ssid
Done thanks. https://codereview.chromium.org/1531463004/diff/20001/base/trace_event/malloc_dump_provider.cc File base/trace_event/malloc_dump_provider.cc (right): https://codereview.chromium.org/1531463004/diff/20001/base/trace_event/malloc_dump_provider.cc#newcode56 base/trace_event/malloc_dump_provider.cc:56: // the whole region other than the ...
5 years ago (2015-12-18 17:50:27 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1531463004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1531463004/60001
5 years ago (2015-12-18 17:51:19 UTC) #9
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-12-18 19:10:52 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1531463004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1531463004/60001
5 years ago (2015-12-21 10:13:17 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:60001)
5 years ago (2015-12-21 11:45:42 UTC) #16
commit-bot: I haz the power
5 years ago (2015-12-21 11:46:28 UTC) #18
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/86f78c1c70715d6f43ab59fa6cc51be4c1dc7774
Cr-Commit-Position: refs/heads/master@{#366366}

Powered by Google App Engine
This is Rietveld 408576698