how to iterate java heap to count java objects within different class loader , and they have following references with each other. For example, X class loader loads 3 class with 3 objects, and these 3 objects have a reference to another 2 objects, and these 2 objects are loaded by Y class loader. Calc result is count(x->y) = 2
search the stackoverflow