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

Issue 2623613003: Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… (Closed)

Created:
3 years, 11 months ago by bkonyi
Modified:
3 years, 11 months ago
Reviewers:
zra, Cutch, siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmalloc. Also updated BUILD.gn files to account for include paths within the tcmalloc project. BUG= R=zra@google.com Committed: https://github.com/dart-lang/sdk/commit/bcd7ba105645d24813333c4ca5bb55b202a6a563

Patch Set 1 #

Patch Set 2 : Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… #

Total comments: 3

Patch Set 3 : Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… #

Total comments: 36

Patch Set 4 : Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… #

Total comments: 28

Patch Set 5 : Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… #

Total comments: 12

Patch Set 6 : Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… #

Total comments: 2

Patch Set 7 : Changed setter for malloc hooks state from SetInitialized to set_initialized #

Total comments: 6

Patch Set 8 : Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… #

Patch Set 9 : Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… #

Total comments: 27

Patch Set 10 : Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… #

Patch Set 11 : Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… #

Total comments: 10

Patch Set 12 : Implemented basic heap memory allocation tracking in MallocHooks using hooks registered with tcmall… #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+499 lines, -11 lines) Patch
M runtime/BUILD.gn View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M runtime/bin/BUILD.gn View 1 2 3 4 2 chunks +4 lines, -1 line 0 comments Download
M runtime/bin/gen_snapshot.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/dart.cc View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -1 line 0 comments Download
M runtime/vm/hash_map.h View 1 2 3 4 2 chunks +57 lines, -0 lines 0 comments Download
M runtime/vm/hash_map_test.cc View 1 2 3 4 2 chunks +61 lines, -0 lines 0 comments Download
M runtime/vm/malloc_hooks.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +7 lines, -1 line 0 comments Download
M runtime/vm/malloc_hooks.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +251 lines, -4 lines 0 comments Download
A runtime/vm/malloc_hooks_test.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +80 lines, -0 lines 0 comments Download
M runtime/vm/malloc_hooks_unsupported.cc View 1 2 3 4 5 6 7 8 1 chunk +25 lines, -3 lines 1 comment Download
M runtime/vm/vm_sources.gypi View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 31 (3 generated)
bkonyi
This change introduces some simple tracking of native heap memory allocations using tcmalloc hooks. There ...
3 years, 11 months ago (2017-01-10 23:29:31 UTC) #2
Cutch
DBC and I'm wondering why this code is inside the VM and not inside the ...
3 years, 11 months ago (2017-01-10 23:37:54 UTC) #4
bkonyi
https://codereview.chromium.org/2623613003/diff/40001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/40001/runtime/vm/malloc_hooks.cc#newcode47 runtime/vm/malloc_hooks.cc:47: ASSERT(MallocHook::AddNewHook(&RecordAllocHook)); On 2017/01/10 at 23:37:54, Cutch wrote: > Code ...
3 years, 11 months ago (2017-01-10 23:43:40 UTC) #5
bkonyi
On 2017/01/10 at 23:37:54, johnmccutchan wrote: > DBC and I'm wondering why this code is ...
3 years, 11 months ago (2017-01-10 23:46:03 UTC) #6
zra
initial comments https://codereview.chromium.org/2623613003/diff/40001/runtime/BUILD.gn File runtime/BUILD.gn (right): https://codereview.chromium.org/2623613003/diff/40001/runtime/BUILD.gn#newcode151 runtime/BUILD.gn:151: include_dirs = [ "." ] An empty ...
3 years, 11 months ago (2017-01-11 00:07:31 UTC) #7
bkonyi
https://codereview.chromium.org/2623613003/diff/40001/runtime/vm/dart_api_impl.cc File runtime/vm/dart_api_impl.cc (right): https://codereview.chromium.org/2623613003/diff/40001/runtime/vm/dart_api_impl.cc#newcode1164 runtime/vm/dart_api_impl.cc:1164: MallocHooks::Init(); On 2017/01/11 at 00:07:31, zra wrote: > It ...
3 years, 11 months ago (2017-01-11 00:58:23 UTC) #8
zra
On 2017/01/11 00:58:23, bkonyi wrote: > https://codereview.chromium.org/2623613003/diff/40001/runtime/vm/dart_api_impl.cc > File runtime/vm/dart_api_impl.cc (right): > > https://codereview.chromium.org/2623613003/diff/40001/runtime/vm/dart_api_impl.cc#newcode1164 > ...
3 years, 11 months ago (2017-01-11 03:44:30 UTC) #9
zra
After seeing what you have to do to use tcmalloc's data structures/functions, I think we ...
3 years, 11 months ago (2017-01-11 07:12:45 UTC) #10
bkonyi
I've finished re-implementing the malloc_hooks code to not be dependent on internal data structures of ...
3 years, 11 months ago (2017-01-13 18:34:02 UTC) #11
zra
https://codereview.chromium.org/2623613003/diff/60001/runtime/bin/BUILD.gn File runtime/bin/BUILD.gn (right): https://codereview.chromium.org/2623613003/diff/60001/runtime/bin/BUILD.gn#newcode298 runtime/bin/BUILD.gn:298: defines = [] Looks like this can be removed. ...
3 years, 11 months ago (2017-01-13 19:14:18 UTC) #12
bkonyi
https://codereview.chromium.org/2623613003/diff/60001/runtime/vm/dart.cc File runtime/vm/dart.cc (right): https://codereview.chromium.org/2623613003/diff/60001/runtime/vm/dart.cc#newcode158 runtime/vm/dart.cc:158: MallocHooks::Init(); On 2017/01/13 at 19:14:17, zra wrote: > Can ...
3 years, 11 months ago (2017-01-13 19:17:43 UTC) #13
bkonyi
https://codereview.chromium.org/2623613003/diff/60001/runtime/bin/BUILD.gn File runtime/bin/BUILD.gn (right): https://codereview.chromium.org/2623613003/diff/60001/runtime/bin/BUILD.gn#newcode298 runtime/bin/BUILD.gn:298: defines = [] On 2017/01/13 at 19:14:17, zra wrote: ...
3 years, 11 months ago (2017-01-13 23:12:10 UTC) #14
zra
https://codereview.chromium.org/2623613003/diff/80001/runtime/vm/dart.cc File runtime/vm/dart.cc (right): https://codereview.chromium.org/2623613003/diff/80001/runtime/vm/dart.cc#newcode158 runtime/vm/dart.cc:158: MallocHooks::Init(); Is it possible to move this up? Maybe ...
3 years, 11 months ago (2017-01-13 23:30:38 UTC) #15
bkonyi
https://codereview.chromium.org/2623613003/diff/80001/runtime/vm/dart.cc File runtime/vm/dart.cc (right): https://codereview.chromium.org/2623613003/diff/80001/runtime/vm/dart.cc#newcode158 runtime/vm/dart.cc:158: MallocHooks::Init(); On 2017/01/13 at 23:30:37, zra wrote: > Is ...
3 years, 11 months ago (2017-01-14 01:01:56 UTC) #16
zra
Let's discuss how to get performance numbers on Tuesday morning. https://codereview.chromium.org/2623613003/diff/100001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/100001/runtime/vm/malloc_hooks.cc#newcode97 ...
3 years, 11 months ago (2017-01-17 03:35:06 UTC) #17
bkonyi
https://codereview.chromium.org/2623613003/diff/100001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/100001/runtime/vm/malloc_hooks.cc#newcode97 runtime/vm/malloc_hooks.cc:97: static void SetInitialized() { initialized_ = true; } On ...
3 years, 11 months ago (2017-01-17 18:50:15 UTC) #18
zra
https://codereview.chromium.org/2623613003/diff/120001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/120001/runtime/vm/malloc_hooks.cc#newcode5 runtime/vm/malloc_hooks.cc:5: #if defined(DART_USE_TCMALLOC) #include "platform/globals.h" #if defined(DART_USE_TCMALLOC) && !defined(PRODUCT) https://codereview.chromium.org/2623613003/diff/120001/runtime/vm/malloc_hooks_test.cc ...
3 years, 11 months ago (2017-01-17 22:30:50 UTC) #19
bkonyi
https://codereview.chromium.org/2623613003/diff/120001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/120001/runtime/vm/malloc_hooks.cc#newcode6 runtime/vm/malloc_hooks.cc:6: Done. https://codereview.chromium.org/2623613003/diff/120001/runtime/vm/malloc_hooks_test.cc File runtime/vm/malloc_hooks_test.cc (right): https://codereview.chromium.org/2623613003/diff/120001/runtime/vm/malloc_hooks_test.cc#newcode5 runtime/vm/malloc_hooks_test.cc:5: #if defined(DART_USE_TCMALLOC) ...
3 years, 11 months ago (2017-01-18 01:07:02 UTC) #20
Cutch
DBC https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc#newcode38 runtime/vm/malloc_hooks.cc:38: return OSThread::GetThreadLocal(in_malloc_hook_flag_); ASSERT(in_malloc_hook_flag_ != kUnsetThreadLocalKey); https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc#newcode49 runtime/vm/malloc_hooks.cc:49: // ...
3 years, 11 months ago (2017-01-18 17:14:00 UTC) #21
zra
https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc#newcode135 runtime/vm/malloc_hooks.cc:135: static Mutex malloc_hook_mutex_; Just ran into this while running ...
3 years, 11 months ago (2017-01-18 17:30:44 UTC) #22
zra
https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc#newcode21 runtime/vm/malloc_hooks.cc:21: class MallocHookFlagHolder { Maybe MallocHookScope? MallocHookSingleEntryScope if we want ...
3 years, 11 months ago (2017-01-18 18:26:13 UTC) #23
bkonyi
https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc#newcode21 runtime/vm/malloc_hooks.cc:21: class MallocHookFlagHolder { On 2017/01/18 at 18:26:12, zra wrote: ...
3 years, 11 months ago (2017-01-18 20:02:42 UTC) #24
bkonyi
https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/160001/runtime/vm/malloc_hooks.cc#newcode111 runtime/vm/malloc_hooks.cc:111: static void IncrementHeapAllocatedMemoryInBytes(uintptr_t size) { On 2017/01/18 at 20:02:42, ...
3 years, 11 months ago (2017-01-18 20:35:03 UTC) #25
zra
https://codereview.chromium.org/2623613003/diff/200001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/200001/runtime/vm/malloc_hooks.cc#newcode35 runtime/vm/malloc_hooks.cc:35: MallocHookScope() { OSThread::SetThreadLocal(in_malloc_hook_flag_, 1); } Let's add ASSERT(in_malloc_hook_flag_ != ...
3 years, 11 months ago (2017-01-18 21:53:30 UTC) #26
bkonyi
https://codereview.chromium.org/2623613003/diff/200001/runtime/vm/malloc_hooks.cc File runtime/vm/malloc_hooks.cc (right): https://codereview.chromium.org/2623613003/diff/200001/runtime/vm/malloc_hooks.cc#newcode35 runtime/vm/malloc_hooks.cc:35: MallocHookScope() { OSThread::SetThreadLocal(in_malloc_hook_flag_, 1); } On 2017/01/18 at 21:53:30, ...
3 years, 11 months ago (2017-01-19 00:23:43 UTC) #27
zra
lgtm
3 years, 11 months ago (2017-01-19 03:39:39 UTC) #28
bkonyi
Committed patchset #12 (id:220001) manually as bcd7ba105645d24813333c4ca5bb55b202a6a563 (presubmit successful).
3 years, 11 months ago (2017-01-19 20:09:16 UTC) #30
zra
3 years, 11 months ago (2017-01-19 20:15:16 UTC) #31
Message was sent while issue was closed.
https://codereview.chromium.org/2623613003/diff/220001/runtime/vm/malloc_hook...
File runtime/vm/malloc_hooks_unsupported.cc (right):

https://codereview.chromium.org/2623613003/diff/220001/runtime/vm/malloc_hook...
runtime/vm/malloc_hooks_unsupported.cc:13: void MallocHooks::Init() {
Looks like these definitions didn't get updated after some other changes.

Powered by Google App Engine
This is Rietveld 408576698