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

Issue 10452006: Implement a heap profiler for the Dart managed heap. (Closed)

Created:
8 years, 7 months ago by cshapiro
Modified:
8 years, 6 months ago
Reviewers:
turnidge, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Implement a heap profiler for the Dart managed heap. This profiler will write binary HPROF data to a user provided stream that can later be viewed by tools such as the Eclipse Memory Analyzer. While all user defined types are accurately described in the profile data, internal types that are not self-describing appear as empty objects. This will be addressed by a future change. Committed: https://code.google.com/p/dart/source/detail?r=8636

Patch Set 1 #

Total comments: 18

Patch Set 2 : address review comments, modulo test code #

Patch Set 3 : added basic test code #

Total comments: 6

Patch Set 4 : address final review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1322 lines, -14 lines) Patch
M runtime/include/dart_api.h View 1 2 3 2 chunks +24 lines, -1 line 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
M runtime/vm/heap.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/heap.cc View 1 2 3 2 chunks +24 lines, -0 lines 0 comments Download
A runtime/vm/heap_profiler.h View 1 2 3 1 chunk +313 lines, -0 lines 0 comments Download
A runtime/vm/heap_profiler.cc View 1 2 3 1 chunk +733 lines, -0 lines 0 comments Download
A runtime/vm/heap_profiler_test.cc View 1 2 1 chunk +121 lines, -0 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/pages.h View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M runtime/vm/pages.cc View 1 2 3 2 chunks +27 lines, -0 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 3 4 chunks +10 lines, -2 lines 0 comments Download
M runtime/vm/raw_object.cc View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download
M runtime/vm/scavenger.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/scavenger.cc View 1 2 3 1 chunk +10 lines, -0 lines 0 comments Download
M runtime/vm/unicode.h View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/unicode.cc View 1 chunk +14 lines, -9 lines 0 comments Download
M runtime/vm/visitor.h View 1 2 3 1 chunk +10 lines, -0 lines 0 comments Download
M runtime/vm/vm_sources.gypi View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
cshapiro
8 years, 7 months ago (2012-05-24 06:01:35 UTC) #1
turnidge
I would like to see a basic sanity test for the heap profiler, if possible. ...
8 years, 6 months ago (2012-05-29 17:50:01 UTC) #2
cshapiro
I will think about how to test this code and re-upload. http://codereview.chromium.org/10452006/diff/1/runtime/include/dart_api.h File runtime/include/dart_api.h (right): ...
8 years, 6 months ago (2012-06-01 04:27:02 UTC) #3
cshapiro
PTAL
8 years, 6 months ago (2012-06-02 00:18:56 UTC) #4
turnidge
LGTM. https://chromiumcodereview.appspot.com/10452006/diff/8001/runtime/vm/heap_profiler.cc File runtime/vm/heap_profiler.cc (right): https://chromiumcodereview.appspot.com/10452006/diff/8001/runtime/vm/heap_profiler.cc#newcode27 runtime/vm/heap_profiler.cc:27: size_ += size; It's a bit confusing to ...
8 years, 6 months ago (2012-06-12 17:02:19 UTC) #5
cshapiro
8 years, 6 months ago (2012-06-14 00:08:36 UTC) #6
https://chromiumcodereview.appspot.com/10452006/diff/8001/runtime/vm/heap_pro...
File runtime/vm/heap_profiler.cc (right):

https://chromiumcodereview.appspot.com/10452006/diff/8001/runtime/vm/heap_pro...
runtime/vm/heap_profiler.cc:27: size_ += size;
I see where you are coming from.  I would like this to be as readable as
possible.  Can you suggest new names for data and size?

https://chromiumcodereview.appspot.com/10452006/diff/8001/runtime/vm/heap_pro...
runtime/vm/heap_profiler.cc:520: sub.Write32(sizeof(RawClass));
It is the size of instances, not the size of the class object we are dumping.  I
have adjusted the code and added a comment about this.  At present, we do not
handle variable sized objects well and many internal classes have an
indeterminate length.

https://chromiumcodereview.appspot.com/10452006/diff/8001/runtime/vm/raw_obje...
File runtime/vm/raw_object.h (right):

https://chromiumcodereview.appspot.com/10452006/diff/8001/runtime/vm/raw_obje...
runtime/vm/raw_object.h:1264: friend class HeapProfiler;
I think that is a good idea.  I have pulled this up into a HEAP_PROFILER_SUPPORT
macro.  It cleans up the diff nicely.

Powered by Google App Engine
This is Rietveld 408576698