mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 10:18:13 +00:00
[vm] Add examples to heapsnapshot tool
Change-Id: I2b3735341146e532a747e302050e3983ee8f7e1c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273240 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
This commit is contained in:
parent
7a3aa5c7f5
commit
93ef21b00b
67
runtime/tools/heapsnapshot/README
Normal file
67
runtime/tools/heapsnapshot/README
Normal file
|
@ -0,0 +1,67 @@
|
|||
Examples:
|
||||
|
||||
# Load
|
||||
load <file>
|
||||
|
||||
# Show named sets / known variables
|
||||
info
|
||||
|
||||
# Find live objects
|
||||
closure roots
|
||||
|
||||
# or give a name
|
||||
all = closure roots
|
||||
|
||||
# Look into the object
|
||||
stats all
|
||||
|
||||
# Filter lists from "all" into "lists"
|
||||
lists = filter all _List
|
||||
|
||||
# Find empty lists into "empty-lists"
|
||||
empty-lists = dfilter lists ==0
|
||||
|
||||
# Who's using the empty lists?
|
||||
users empty-lists
|
||||
|
||||
# print that info (from $0 in this case as we didn't give it a name but it was
|
||||
# the first one we didn't give a name)
|
||||
stat $0
|
||||
|
||||
# Filter more
|
||||
empty-growable-lists = filter (users empty-lists) _GrowableList
|
||||
|
||||
# Print
|
||||
stats empty-growable-lists
|
||||
|
||||
# Who's using them?
|
||||
retainers empty-growable-lists
|
||||
|
||||
# Look into strings next
|
||||
strings = filter all String
|
||||
|
||||
# What's inside the strings
|
||||
dstats strings
|
||||
|
||||
# Who's pointing to the big strings?
|
||||
retainers (dfilter strings >=1024)
|
||||
|
||||
# Small strings
|
||||
small-strings = dfilter strings <100
|
||||
|
||||
# See them
|
||||
dstats small-strings
|
||||
|
||||
# Who's retaining the string "foo"
|
||||
f = dfilter small-strings foo
|
||||
retainters f
|
||||
|
||||
# Find stuff with specific field
|
||||
hasField = filter all :specificField
|
||||
stats closure hasField :specificField
|
||||
foo = follow hasField :specificField
|
||||
stats closure foo
|
||||
|
||||
# Stop the closure search if going into specific files
|
||||
stats closure foo ^file1.dart ^file2.dart ^file3.dart
|
||||
|
Loading…
Reference in a new issue