[Glass] orphaned classes do not disappear

Johan Brichau via Glass glass at lists.gemtalksystems.com
Thu Mar 16 09:11:12 PDT 2017

Hi Dale,

> On 10 Mar 2017, at 16:25, Dale Henrichs via Glass <glass at lists.gemtalksystems.com> wrote:
> Are the orphaned classes still in the class history of current class version?

No, the classHistories all contain only the current version of the class.
It seems the classHistory object is the same as the one referenced by the current version.

> Have you tried calling Repository>>findReferencePathToObjs:limitObjArray:findAllRefs:printToLog: with an empty limitObjArray? I think that the default listReferences code uses something similar to Repository>>buildLimitSetForRefPathScan as it's list of repository roots, which are ignored for purposes of list references, but probably still useful when hunting down stale metaclass refs.

I tried this but you cannot pass an empty array (there is an explicit check in the method).
However, I tried passing an array { #none } and still did not find any reference paths for a single MetaClass instance.
When I try passing the entire list of metaclasses, I hit an error:

The object with object ID 1339726081 is corrupt. Reason: ‘Error no limit oop found in last chain link for search oop 1339726081
The object in question is such a MetaClass instance.


> Dale
> On 3/8/17 4:01 AM, Johan Brichau via Glass wrote:
>> Hi there,
>> I am working on preparing a GS extent for upgrade to GS 3.2
>> For that, I am cleaning the repo such that no orphaned class instances still exist.
>> I hit an issue because I find orphaned classes that are not GC’ed for which no instances still exist.
>> When I ask the reference path to the class object, it tells me it is being referenced by its metaclass.
>> However, when I ask for the reference path to the metaclass object, I get a ‘false’ response.
>> Is there anything I can do to make sure these instances (of MetaClass) are removed (or otherwise find out why they are not GC’ed) ?
>> thanks
>> Johan
>> For reference, this is the script to find orphaned classes:
>>  | classes orphans |
>>     classes := IdentitySet new.
>>     System myUserProfile symbolList do: [:symbolDictionary |
>>       symbolDictionary valuesDo: [:global |
>>               global isBehavior ifTrue: [ classes add: global ]]].
>>     System commitTransaction.
>>     orphans :=  (Metaclass allInstances collect: [:mClass | mClass theNonMetaClass ])
>>                               select: [:class | (classes includes: class) not ].
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass

More information about the Glass mailing list