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

Issue 3124024: Heap profiler: allow returning aggregated snapshots via the new API. (Closed)

Created:
10 years, 4 months ago by mnaganov (inactive)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Heap profiler: allow returning aggregated snapshots via the new API. This is intended for smoother migration to the new API in Chromium. Also, aggregated heap snapshots can be used for cheaply obtaining heap statistics, e.g. in tests. Committed: http://code.google.com/p/v8/source/detail?r=5297

Patch Set 1 #

Total comments: 6

Patch Set 2 : Comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+717 lines, -139 lines) Patch
M include/v8-profiler.h View 1 4 chunks +28 lines, -4 lines 0 comments Download
M src/api.cc View 1 3 chunks +28 lines, -2 lines 0 comments Download
M src/heap-profiler.h View 1 7 chunks +56 lines, -8 lines 0 comments Download
M src/heap-profiler.cc View 1 8 chunks +381 lines, -63 lines 0 comments Download
M src/profile-generator.h View 1 10 chunks +32 lines, -6 lines 0 comments Download
M src/profile-generator.cc View 1 13 chunks +42 lines, -49 lines 0 comments Download
M src/profile-generator-inl.h View 2 chunks +25 lines, -7 lines 0 comments Download
M test/cctest/test-heap-profiler.cc View 1 4 chunks +125 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/3124024/diff/1/2 File include/v8-profiler.h (right): http://codereview.chromium.org/3124024/diff/1/2#newcode351 include/v8-profiler.h:351: bool aggregated = false); How about using an ...
10 years, 4 months ago (2010-08-17 13:08:59 UTC) #1
mnaganov (inactive)
10 years, 4 months ago (2010-08-17 14:55:34 UTC) #2
Thanks for your comments!

Sorry, I forgot to send a notification email about this issue.

http://codereview.chromium.org/3124024/diff/1/2
File include/v8-profiler.h (right):

http://codereview.chromium.org/3124024/diff/1/2#newcode351
include/v8-profiler.h:351: bool aggregated = false);
On 2010/08/17 13:08:59, Søren Gjesse wrote:
> How about using an enum instead of a bool here:
> 
> enum HeapSnapshotType {
>   kHeapSnapshotTypeFull,
>   kHeapSnapshotTypeAggregated
> }
> 
> That would allow more changes to be added and provide more information when
> looking at the call site.

A good idea. I've introduced 'enum Type' in HeapSnapshot.

http://codereview.chromium.org/3124024/diff/1/4
File src/heap-profiler.cc (right):

http://codereview.chromium.org/3124024/diff/1/4#newcode370
src/heap-profiler.cc:370: AggregatedHeapSnapshot agg_snapshot;
On 2010/08/17 13:08:59, Søren Gjesse wrote:
> Can't agg_snapshot just be a member of AggregatedHeapSnapshotGenerator (it is
> just passed in he constructor)?

This is for alignment with HeapSnapshotGenerator. In my ideology, a generator
doesn't own the profile, it just fills it out.

http://codereview.chromium.org/3124024/diff/1/9
File test/cctest/test-heap-profiler.cc (right):

http://codereview.chromium.org/3124024/diff/1/9#newcode935
test/cctest/test-heap-profiler.cc:935: CHECK_NE(0, maps->GetId());
On 2010/08/17 13:08:59, Søren Gjesse wrote:
> GetId() returns the number of objects in an aggregated snapshot? That seems a
> bit odd. Is the intend that the heap is the same if the same number of objects
> of a specific type is present -> same id?

For an aggregated snapshots, instance ids just doesn't make sense, because they
contain no instances, so I reused this field for storing instances count. But
you are right, this is confusing, so I've split this into two specific methods
which check snapshot type.

Powered by Google App Engine
This is Rietveld 408576698