... where "93 MB" is the cumulative "shallow size" for all objects that are strong reachable via a GC root.

Is it possible to get this same number -- the "93 MB" number from the example above -- from a memory snapshot programmatically, via the com.yourkit.api.MemorySnapshot (or some other) API? I believe the MemorySnapshot.getShallowSize() method uses XML query syntax like the examples on the "set description language" page (https://www.yourkit.com/docs/java/help/language.jsp). I haven't found anything on that page, though, which mentions anything specific about filtering the list of objects selected to only those which are reachable from GC roots via strong references, like what is shown in the Profiler GUI.

A query like "<objects class=\"*\">" would seem to just give all available objects. A query like "<retained-objects><roots/></retained-objects>" appears to consider the cumulative set of objects that are reachable from GC roots but this also appears to include objects that aren't included in the "strong reachable" filter that the GUI provides.

This is not exactly the same as the strongly reachable objects as seen in the UI. The difference is that the above description also includes the finalization queue elements which are instances of java.lang.ref.Finalizer. Note this does not include the objects pending finalization themselves, just the finalization queue itself, i.e. "shallow" list. Nevertheless, this should be a minor fraction of objects and perhaps you can simply ignore it.

If you want, we can consider adding a dedicated tag for objects with given reachability scope in the next EAP build.

Thanks, that query looks great. With one slight change to filter out the 'java.lang.ref.Finalizer' objects, it seems to be giving me the same object set as what I see by just clicking on the "Strong References" link - at least for the first few snapshots I've looked at. Here's what I'm using: