leakcanary
leakcanary copied to clipboard
Initial draft to dump a heap dump into Neo4j
Uses Neo4j embedded and dumps every object in the heap dump in a single transaction, without any edges yet.
Syntax:
shark-cli --hprof PATH_TO_HPROF neo4j
match (roots: GcRoots) return roots
match (activity: Instance) -[:CLASS|SUPER*1..]-> (c:Class {className: "android.app.Activity"}) return activity
match (activity: Instance) -[:CLASS|SUPER*1..]-> (c:Class {className: "android.app.Activity"}) where "android.app.Activity.mDestroyed = true" in activity.fields return activity
match (roots: GcRoots) match (activity: Instance) -[:CLASS|SUPER*1..]->(c:Class {className: "android.app.Activity"}) where "android.app.Activity.mDestroyed = true" in activity.fields return shortestPath((roots)-[:ROOT|REF*]->(activity))
nit: https://neo4j.com/docs/cypher-manual/current/styleguide/ ;)
