Commit Graph

33 Commits

Author SHA1 Message Date
vitalyr@chromium.org
6ff7fdebd3 Merge isolates to bleeding_edge.
Review URL: http://codereview.chromium.org/6685088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 18:49:56 +00:00
mikhail.naganov@gmail.com
dee9c00267 Add an interface for an embedder to provide information about native
objects retained by object groups and global handles.

This information is then used during heap snapshot generation
to provide a more complete memory picture.

This patch will be needed to fix https://bugs.webkit.org/show_bug.cgi?id=53659.

Review URL: http://codereview.chromium.org/6626043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7125 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-10 12:05:31 +00:00
mikhail.naganov@gmail.com
5cf643aa42 New heap profiler: add support for progress reporting and control.
As taking a snapshot of a large heap takes noticeable time, it's
good to be able to monitor and control it.

The change itself is small, big code deletes and additions are in
fact moves. The only significant change is simplification of
approximated retained sizes calculation algorithm.

Review URL: http://codereview.chromium.org/5687003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5978 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-13 10:42:06 +00:00
mikhail.naganov@gmail.com
dd1a7fa2b3 New Heap Profiler: add API method for finding a graph node by id.
TEST=cctest/test-heap-profiler/HeapSnapshotGetNodeById

Review URL: http://codereview.chromium.org/5537001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5914 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-02 15:38:51 +00:00
mikhail.naganov@gmail.com
0634c50950 New Heap profiler: fix JSON serialization of aggregated profiles.
Serialization was failing due to unset dominator pointers.

TEST=test-heap-snapshot/AggregatedHeapSnapshotJSONSerialization

Review URL: http://codereview.chromium.org/5314003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5888 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-24 10:47:18 +00:00
mikhail.naganov@gmail.com
1cfc63cf8a New heap profiler: implement fast retaining sizes approximation.
Approximation is done by building a dominators tree for the heap graph.
Dominator nodes and retained sizes are serialized into JSON.

Removed:
 - reachable size (it is useless, after all);
 - HeapEntryCalculatedData (size is now stored in the node, retaining
   paths in a hash map);

Review URL: http://codereview.chromium.org/5154007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5867 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-22 14:00:40 +00:00
mikhail.naganov@gmail.com
051f314a99 New heap profiler: include all heap objects and refs into snapshot.
Otherwise, retaned memory sizes are not precise. This increases size
of heap snapshot, I will deal with this later. Heap objects and
references previously missing in snapshot are now marked as 'hidden'.
That means, they not shown to user, but participate in sizes
calculation.

Other small changes:
 - added 'shortcut' graph edges: e.g. to pin global objects on top
   level;
 - meta-information in JSON snapshot is no more double encoded.

Review URL: http://codereview.chromium.org/5139002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5849 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-18 10:38:25 +00:00
mikhail.naganov@gmail.com
0f66199b5e Heap profiler: remove context checks for objects.
It seems that there will be no access to heap snapshots from
web pages' code, only from Developer Tools, thus it makes no
sense doing filtering of object by their security contexts.

Review URL: http://codereview.chromium.org/4681003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5787 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-08 15:18:12 +00:00
mikhail.naganov@gmail.com
d4bc8e1585 New Heap profiler: add dumping HeapNumbers and InternalFields to snapshot.
HeapNumbers do consume memory, so it's worth dumping them. However, we
don't dump their values, as they are not as self-descriptive as values
of strings, and they will increase snapshot size. Storing heap numbers
values can be added if we will feel a sufficient demand for that.

InternalFields are used, e.g. for storing references to DOM nodes
event handlers.

Review URL: http://codereview.chromium.org/3769007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5635 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-18 09:15:38 +00:00
mikhail.naganov@gmail.com
788c5e344d Better align heap snapshots contents with debugger info.
I created a heap snapshot in Chromium, and then started comparing
it side-by-side with representations of objects provided by
the debugger, fixing discrepancies.

Review URL: http://codereview.chromium.org/3590029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5612 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-13 14:57:00 +00:00
mikhail.naganov@gmail.com
5a30072502 Fix HeapSnapshotsDiff test, diff implementation, and a bug introduced
during snapshot size optimization.

Sorry, now I figured out that the diff implementation itself was also
incorrect.  Reachable nodes must be filtered from the beginning,
otherwise, an object that is already disconnected, but not discarded
yet, will not appear as a deleted (thankfully, this bug for some
reason had appeared on the x64 port.)

BUG=868
TEST=HeapSnapshotRootPreservedAfterSorting

Review URL: http://codereview.chromium.org/3531005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5570 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-01 07:19:23 +00:00
mikhail.naganov@gmail.com
44050b12b9 Revert last commit due to check fail on Linux.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5568 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-30 12:35:03 +00:00
mikhail.naganov@gmail.com
99c276bbbc Fix HeapSnapshotsDiff test and a bug introduced during snapshot size optimization.
The bug wasn't revealed because the test was disabled.

BUG=848
TEST=HeapSnapshotsDiff,HeapSnapshotRootPreservedAfterSorting

Review URL: http://codereview.chromium.org/3572003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5567 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-30 12:24:56 +00:00
mikhail.naganov@gmail.com
228d56bd8e Add support for abortion in v8::OutputStream.
It's a good idea to allow receiver to interrupt data transmission.

Review URL: http://codereview.chromium.org/3409002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5452 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-14 15:11:24 +00:00
mikhail.naganov@gmail.com
2388079051 Implement heap snapshots serialization into JSON. API is designed
to avoid storing serialized snapshot on VM, instead it is emitted
using output stream interface.

The size of JSON emitted is roughly equal to used heap size
(when stored as an ASCII string).

Now a whole heap snapshot can be serialized and transmitted outside
VM. This makes possible:
  - implementing non-async UI for heap snapshots inspection;
  - storing heap snapshots for further inspection;
  - remote profiling (we can even implement a snapshotting mode
    where a snapshot isn't even stored in VM, only transmitted --
    good for mobile devices);
  - creating tools for outside heap snapshots processing, e.g.
    converting to HPROF.

Review URL: http://codereview.chromium.org/3311028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5450 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-14 11:49:06 +00:00
mikhail.naganov@gmail.com
e839a1ca58 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.

Review URL: http://codereview.chromium.org/3124024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5297 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-18 08:19:29 +00:00
mikhail.naganov@gmail.com
0765b6ea3e Fix issue 822: handling of JSObject::elements in CalculateNetworkSize.
BUG=822
TEST=test-heap-profiler/Issue822

Review URL: http://codereview.chromium.org/3128004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5235 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-11 09:03:23 +00:00
mikhail.naganov@gmail.com
1695003bb9 Heap profiler: reduce heap snapshots size.
The size of a snapshot is now 65-80% of the JS heap size (tested on
GMail and Wave), previously it was >200%.

BUG=783

Review URL: http://codereview.chromium.org/3060008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5211 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-09 11:37:24 +00:00
mikhail.naganov@gmail.com
3471e873ab Fix presubmit errors in test-heap-profiler.cc
I tried adding CheckNonEqualsHelper for int64_t, but this causes
another avalanche of function resolving ambuguities. So, I ended
up fooling linter.

TBR=ager@chromium.org

Review URL: http://codereview.chromium.org/3024001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5081 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-15 15:01:42 +00:00
mikhail.naganov@gmail.com
522faec553 Fix compile errors on Linux x64 and Windows.
Will fix test-heap-profiler in the next change.

TBR=ager@chromium.org

Review URL: http://codereview.chromium.org/2877019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5079 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-15 14:28:52 +00:00
mikhail.naganov@gmail.com
c98ac6e82c Heap profiler: implement diffing of snapshots.
To trace objects between snapshots, an external map of object tags is
maintained. After the first heap snapshot has been taken, the map is
updated by reporting object moves from the GC. If no snapshots were
taken, there is no overhead (except for flag checking).

I considered graph comparison algorithms that doesn't require using
object tags, but they are all of a high computational complexity, and
will still fail to detect object moves properly, even for trivial
cases, so using tags looks like unavoidable.

Review URL: http://codereview.chromium.org/3020002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5078 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-15 13:21:50 +00:00
kaznacheev@chromium.org
0243bc875c Move serialized scope info from Code object to SharedFunctionInfo.
The scope info is now stored in a FixedArray referenced from SharedFunctionInfo.


Review URL: http://codereview.chromium.org/2918001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5056 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-13 13:06:33 +00:00
mikhail.naganov@gmail.com
b6e6ab6972 Heap profiler: perform a GC round before taking a snapshot
to get rid of global object loaded from a snapshot. This
eliminates the "double global object" issue. Thanks to Mads
for suggesting this!

Review URL: http://codereview.chromium.org/2865013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4917 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-22 14:58:08 +00:00
mikhail.naganov@gmail.com
93387f272e Heap profiler: add a missing link between a function closure and shared function info.
Review URL: http://codereview.chromium.org/2846012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4891 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-17 12:56:55 +00:00
mikhail.naganov@gmail.com
a4cc374d37 Fix HeapSnapshot test in the case when snapshotting is enabled.
TBR=sgjesse@chromium.org

Review URL: http://codereview.chromium.org/2843002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4865 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-15 12:28:25 +00:00
mikhail.naganov@gmail.com
f213b096bc Heap profiler: publish API and add test.
Review URL: http://codereview.chromium.org/2822009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4864 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-06-15 11:44:07 +00:00
ricow@chromium.org
bdd125c611 Added zone-inl.h to test-heap-profiler to fix test build failure after header file refactoring in revision 4058.
Review URL: http://codereview.chromium.org/698002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4059 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-09 08:25:22 +00:00
antonm@chromium.org
29af9c54a4 Merge ObjectIterator::has_next and ObjectIterator::next methods.
This reduces chances of improper usage, see http://code.google.com/p/v8/issues/detail?id=586
for more details.

BUG=586

Review URL: http://codereview.chromium.org/555072

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3696 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-01-25 22:53:18 +00:00
lrn@chromium.org
d53f05e3e2 Fix warnings on Win64.
Set warning level to /W3 and change implicit conversions from size_t
to int. Most "fixes" are simply manifesting the implicit casts or using
a special strlen replacement that returns int.

Review URL: http://codereview.chromium.org/390004


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 09:50:06 +00:00
mikhail.naganov@gmail.com
1ef8754597 Heap profiler: correctly determine equivalence of objects having self-refs.
Review URL: http://codereview.chromium.org/242031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2972 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-28 09:05:06 +00:00
mikhail.naganov@gmail.com
f1a89f3379 Heap profiler: aggregate retainers count of equivalent clusters.
Also perform some refactoring.

Review URL: http://codereview.chromium.org/247001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2971 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-28 07:12:39 +00:00
mikhail.naganov@gmail.com
9b4c950963 Heap profiler: count the number of back references for objects.
Also, perform some refactoring to reuse common code between constructor and retainer profiles.

Review URL: http://codereview.chromium.org/209028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2936 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-18 12:05:18 +00:00
mikhail.naganov@gmail.com
abc0bd46f6 Add initial version of retainers heap profile.
The profile is taken together with constructors profile. In theory, it
should represent a complete heap graph. However, this takes a lot of memory,
so it is reduced to a more compact, but still useful form. Namely:

 - objects are aggregated by their constructors, except for Array and Object
   instances, that are too hetereogeneous;

 - for Arrays and Objects, initially every instance is concerned, but then
   they are grouped together based on their retainer graph paths similarity (e.g.
   if two objects has the same retainer, they are considered equal);

Review URL: http://codereview.chromium.org/200132

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2903 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-09-16 13:41:24 +00:00