[Glass] orphaned classes do not disappear

Johan Brichau via Glass glass at lists.gemtalksystems.com
Wed Mar 8 04:01:16 PST 2017

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) ?


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 ].

More information about the Glass mailing list