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

Issue 12388070: Count m(un)map for each stacktrace in MemoryRegionMap instead of HeapProfileTable. (Closed)

Created:
7 years, 9 months ago by Dai Mikurube (NOT FULLTIME)
Modified:
7 years, 9 months ago
CC:
chromium-reviews, dmikurube+memory_chromium.org, jar (doing other things)
Visibility:
Public.

Description

Count m(un)map for each stacktrace in MemoryRegionMap instead of HeapProfileTable. This patch fixes a bug that gperftools(TCMalloc)'s mmap profiler (HEAP_PROFILE_MMAP) doesn't hook some memory pages used by the profiler itself. This problem has been lived in gperftools for a long time. It is discussed in gperftools' issue 502. https://code.google.com/p/gperftools/issues/detail?id=502 Some bugs in the mmap profiler were fixed by https://code.google.com/p/gperftools/issues/detail?id=383, but the patch in the issue 383 didn't fix the bug mentioned in the issue 502. This change reverts the previous patch and http://crrev.com/132771 at first. Then, it modifies MemoryRegionMap to count m(un)map calls for each stacktrace in itself instead of merging the counts for each stacktrace in HeapProfileTable. This change also cleans up heap-profiler, heap-profile-table and deep-heap-profile. This change is to be upstreamed to the original gperftools against the issue 502. BUG=181517 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=188176

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : ready #

Total comments: 2

Patch Set 8 : rebased #

Patch Set 9 : nit fix #

Patch Set 10 : nit fix #

Total comments: 44

Patch Set 11 : addressed the comments #

Total comments: 6

Patch Set 12 : addressed the comments #8 #

Patch Set 13 : added comments for functions #

Total comments: 44

Patch Set 14 : addressed jar's comments #

Total comments: 20

Patch Set 15 : addressed willchan's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+499 lines, -435 lines) Patch
M third_party/tcmalloc/chromium/src/deep-heap-profile.h View 1 2 3 4 5 6 7 5 chunks +2 lines, -24 lines 0 comments Download
M third_party/tcmalloc/chromium/src/deep-heap-profile.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 11 chunks +63 lines, -124 lines 0 comments Download
M third_party/tcmalloc/chromium/src/heap-checker.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
A third_party/tcmalloc/chromium/src/heap-profile-stats.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +52 lines, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/heap-profile-table.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 12 chunks +56 lines, -80 lines 0 comments Download
M third_party/tcmalloc/chromium/src/heap-profile-table.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 19 chunks +79 lines, -151 lines 0 comments Download
M third_party/tcmalloc/chromium/src/heap-profiler.cc View 1 2 3 4 5 6 5 chunks +10 lines, -49 lines 0 comments Download
M third_party/tcmalloc/chromium/src/memory_region_map.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 chunks +74 lines, -2 lines 0 comments Download
M third_party/tcmalloc/chromium/src/memory_region_map.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 14 chunks +162 lines, -4 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Dai Mikurube (NOT FULLTIME)
Hi Alexander, Could you take a look at this patch? It fixes a problem described ...
7 years, 9 months ago (2013-03-05 09:10:08 UTC) #1
Dai Mikurube (NOT FULLTIME)
gently ping..., or tell me if you're busy. :)
7 years, 9 months ago (2013-03-07 06:05:17 UTC) #2
Alexander Potapenko
Hi Dai, sorry, I haven't finished the review yesterday and forgot to send the comments. ...
7 years, 9 months ago (2013-03-07 06:07:52 UTC) #3
Alexander Potapenko
https://codereview.chromium.org/12388070/diff/11001/third_party/tcmalloc/chromium/src/deep-heap-profile.cc File third_party/tcmalloc/chromium/src/deep-heap-profile.cc (right): https://codereview.chromium.org/12388070/diff/11001/third_party/tcmalloc/chromium/src/deep-heap-profile.cc#newcode115 third_party/tcmalloc/chromium/src/deep-heap-profile.cc:115: // TODO(dmikurube): Consider using mincore(2). Just wondering - how ...
7 years, 9 months ago (2013-03-07 06:08:25 UTC) #4
Alexander Potapenko
https://codereview.chromium.org/12388070/diff/25001/third_party/tcmalloc/chromium/src/heap-profile-table.cc File third_party/tcmalloc/chromium/src/heap-profile-table.cc (right): https://codereview.chromium.org/12388070/diff/25001/third_party/tcmalloc/chromium/src/heap-profile-table.cc#newcode445 third_party/tcmalloc/chromium/src/heap-profile-table.cc:445: UnparseBucket(*bucket, args->buf, args->buflen, args->bufsize, "mmap", NULL); This line seems ...
7 years, 9 months ago (2013-03-07 06:15:13 UTC) #5
Alexander Potapenko
Some style nits. https://codereview.chromium.org/12388070/diff/25001/third_party/tcmalloc/chromium/src/deep-heap-profile.cc File third_party/tcmalloc/chromium/src/deep-heap-profile.cc (right): https://codereview.chromium.org/12388070/diff/25001/third_party/tcmalloc/chromium/src/deep-heap-profile.cc#newcode680 third_party/tcmalloc/chromium/src/deep-heap-profile.cc:680: NULL, Please provide an inline comment ...
7 years, 9 months ago (2013-03-07 06:48:38 UTC) #6
Dai Mikurube (NOT FULLTIME)
Thanks, Alexander! Updated the patch. I forgot to tell that some code (most of style ...
7 years, 9 months ago (2013-03-07 12:32:16 UTC) #7
Alexander Potapenko
Looks mostly good, I think it's ok to add Jim. https://codereview.chromium.org/12388070/diff/36001/third_party/tcmalloc/chromium/src/deep-heap-profile.cc File third_party/tcmalloc/chromium/src/deep-heap-profile.cc (right): https://codereview.chromium.org/12388070/diff/36001/third_party/tcmalloc/chromium/src/deep-heap-profile.cc#newcode681 ...
7 years, 9 months ago (2013-03-07 14:50:52 UTC) #8
Dai Mikurube (NOT FULLTIME)
Thank you, Alexander. Updated the patch, and answered to your first question at https://codereview.chromium.org/12388070/diff/11001/third_party/tcmalloc/chromium/src/deep-heap-profile.cc#newcode115. (Sorry, ...
7 years, 9 months ago (2013-03-07 17:14:24 UTC) #9
Dai Mikurube (NOT FULLTIME)
Hi Jim, Could you take a look at this change? It changes some non-"profile" files, ...
7 years, 9 months ago (2013-03-07 17:25:50 UTC) #10
jar (doing other things)
Unless there is a compelling reason (enhancing readability by being consistent with local file customs), ...
7 years, 9 months ago (2013-03-08 04:43:31 UTC) #11
Dai Mikurube (NOT FULLTIME)
Switched the reviewer to willchan@ with an agreement. Thanks for taking it, willchan! This change ...
7 years, 9 months ago (2013-03-12 08:24:10 UTC) #12
willchan no longer on Chromium
Hey Dai, I'm looking at it in more detail now and grokking everything. I want ...
7 years, 9 months ago (2013-03-13 15:49:20 UTC) #13
Dai Mikurube (NOT FULLTIME)
Thank you, Will! On 2013/03/13 15:49:20, willchan wrote: > Hey Dai, I'm looking at it ...
7 years, 9 months ago (2013-03-13 16:52:43 UTC) #14
willchan no longer on Chromium
The only major comment I had was about the potential race. Everything else is just ...
7 years, 9 months ago (2013-03-13 21:58:48 UTC) #15
Dai Mikurube (NOT FULLTIME)
Thank you, Will. I renamed variable names in new functions (and functions which got back ...
7 years, 9 months ago (2013-03-14 09:33:46 UTC) #16
willchan no longer on Chromium
Flying to Orlando in a bit, but hopefully I'll finish this before I have to ...
7 years, 9 months ago (2013-03-14 11:41:24 UTC) #17
willchan no longer on Chromium
Great, LGTM
7 years, 9 months ago (2013-03-14 11:45:39 UTC) #18
Dai Mikurube (NOT FULLTIME)
Thank you, Will! I'll be committing...
7 years, 9 months ago (2013-03-14 14:06:56 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmikurube@chromium.org/12388070/67001
7 years, 9 months ago (2013-03-14 14:16:37 UTC) #20
commit-bot: I haz the power
7 years, 9 months ago (2013-03-14 20:34:14 UTC) #21
Message was sent while issue was closed.
Change committed as 188176

Powered by Google App Engine
This is Rietveld 408576698