[Glass] orphaned classes do not disappear

Paul Baumann via Glass glass at lists.gemtalksystems.com
Thu Mar 16 11:58:44 PDT 2017


Complex blocks are one way that context can be preserved longer than
expected. For example, a custom sort block for a SortedCollection instance
that is referenced by a class.


On Mar 16, 2017 12:11 PM, "Johan Brichau via Glass" <
glass at lists.gemtalksystems.com> wrote:

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.

Johan

>
> Dale
>
> On 3/8/17 4:01 AM, Johan Brichau via Glass wrote:
>> Hi there,
>>
>> I am working on preparing a GS 2.4.4.1 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

_______________________________________________
Glass mailing list
Glass at lists.gemtalksystems.com
http://lists.gemtalksystems.com/mailman/listinfo/glass
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20170316/54a26c0f/attachment.html>


More information about the Glass mailing list