On 27 June 2013 14:54, Paul DeBruicker <[email protected]> wrote: > On 06/27/2013 12:48 AM, Camillo Bruni wrote: >> >> On 2013-06-27, at 01:08, Paul DeBruicker <[email protected]> wrote: >> >>> Sven & Camillo, >>> >>> Ok thanks. And using the PointerFinder is there a way to know which of >>> the pointers points to the SystemDictionary or Object someObject or >>> whereever the GC begins so one would not have to check every pointer for >>> every stubborn object. >>> >>> E.g. Lets say I've nil'ed the reference between the Navy and the ship so >>> its ready to go but a few of the soldiers on the ship have references to >>> other ships because their transfer papers weren't processed properly. >>> Running #pointersTo on those soldiers gives a large collection of >>> pointers. >>> >>> >>> How can I use the computer to filter that list to just those references >>> back to the root object? >> >> What do you mean by root object? >> > > I'm sure my understanding is not completely accurate but by 'root > object' I mean whichever object (memory space? pointer?) the VM always > considers as part of the object-space-to-keep when it begins a full GC. > So every object which is kept implicitly points to that object through a > long chain (web?) of pointers. > yes, but in opposite direction. consider yourself a painter which start painting nodes , starting from root ones, then paint ones which they pointing to, then paint ones which those was pointing to (unless they already painted) and so on.. continue until you have nothing to paint left. Then the nodes which remain unpainted is garbage.
If your objects connected via tree pattern, then everything goes well: - high command gives an order to admiral to disassemble his fleet, sink ships with all crew on board - admiral gives commands to captains, they give orders to officers and officers to rest of crew - when lower chain of command completes the order, the higher ones can commit suicide and finally captains press the button to open kingstones and die with ship. - finally admiral will do a harakiri (so, that will be perfect japanese version :) but in russian version (a graph), an admiral's dauther is married on one of the fleet's captains, and admiral, by knowing that gives order only to all but the ship where captain is in command. But that captain is friend with captain of another ship, and he asks admiral to find a way to keep that guy too and that guy can also has friends on other ships.. and so on.. so at the end, only those who has no friends will be fired.. but those who having them, will stay :) > > > >> In any case, if I'm not mistaken, this isn't that easy. Usually you have >> to manually track down and follow the objects in the PointerExplorer >> >> => Inspect an Object, right click, Explore Strong Pointers >> >> >> > > OK. I can imagine a Roassal visualization of a rats nest of objects as > nodes connected with edges made with #pointsTo: with just a few edges > connecting the main blob (e.g. the navy) to objects (soldiers) in a > smaller blob (the ship I want to GC). Kind of like the visualization > Craig Latta uses as the header for his blog and describes here: > https://thiscontext.wordpress.com/2012/10/22/a-detailed-description-of-spoons-object-memory-visualization-tools/ > -- Best regards, Igor Stasenko.
