Heap Snapshot: Inbound references from null _WeakProperty { ⊞ }

25 views
Skip to first unread message

Adam Lofts

unread,
Mar 13, 2016, 12:01:51 PM3/13/16
to Dart VM Observatory Discuss
I am using the Observatory to profile the heap of my app. The dominator tree view of the heap snapshot shows a function called *Pivot.pivotScenario.<pivotScenario_async_body> is not being collected. I think this is a closure generated by the VM for my async function. I have attached a screenshot of this view.

If I click on one of these pivotScenario_async_body objects I get to the object view. In the inbound references section the only references listed are from objects called _WeakProperty. Screenshot attached.

What are these WeakProperties and why are they preventing GC? WeakProperty sounds like it should be a weak reference.

This is with Dart 1.15.0.

I have written a dart native extension for level db which is used by this app so I suppose its possible that I have a problem in its implementation.


Dominator Tree.png
PivotScenario View.png

John Mccutchan

unread,
Mar 14, 2016, 10:02:41 AM3/14/16
to Adam Lofts, Dart VM Observatory Discuss, rma...@google.com

--
You received this message because you are subscribed to the Google Groups "Dart VM Observatory Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to observatory-dis...@dartlang.org.

Adam Lofts

unread,
Mar 14, 2016, 10:45:17 AM3/14/16
to Dart VM Observatory Discuss
I must have not explicitly pressed the GC button before looking at the heap profile. If I take a snapshot after running a GC I do not see any WeakProperties which I assume are weak references.

To prevent others making the same mistake I suggest you put a GC button on the heap profile tab similar to the allocation profile tab. Also perhaps the observatory should run a GC automatically before taking the heap snapshot or this could be an option?

Thanks, Adam
To unsubscribe from this group and stop receiving emails from it, send an email to observatory-discuss+unsub...@dartlang.org.

Ryan Macnak

unread,
Mar 14, 2016, 1:54:21 PM3/14/16
to Adam Lofts, Dart VM Observatory Discuss
The retaining path from your screenshot shows a WeakProperty that is maintaining a dependency between compiled code for pivotScenario and the type of the field PeriodOfMonth.month, so if a value with a different type is stored in the field the VM knows it needs to recompile pivotScenario.

The heap snapshot does not perform a full GC, so it includes weakly-reachable objects. Sometimes including these is interesting, e.g., if a lot of the heap is weakly reachable, maybe the GC policy isn't running full collections often enough. But that's interesting to VM engineers not application developers, so we should make the default heap snapshot perform a full GC first as you suggest.

To unsubscribe from this group and stop receiving emails from it, send an email to observatory-dis...@dartlang.org.

--
You received this message because you are subscribed to the Google Groups "Dart VM Observatory Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to observatory-dis...@dartlang.org.

Reply all
Reply to author
Forward
0 new messages