[squeak-dev] Suspiscious "weak" value reclaimed
arning315 at comcast.net
Mon Mar 26 21:15:50 UTC 2018
Other that the WeakValueDictionary, is there anything referencing either
the class or metaclass? If not, then they would be collected. Perhaps VW
is saving a reference elsewhere?
On 3/26/18 3:07 PM, Nicolas Cellier wrote:
> Hi all,
> while porting MatFileReader to Squeak, I encountered this questionable
> I create classes on the fly for holding Matlab struct().
> I want those classes to be garbage collected when no more used.
> If I store the classes in a WeakArray, then this should normally not work:
> I mean that the classes should not be reclaimed.
> Because the metaclass points strongly to the class (via thisClass
> And the metaclass can't be reclaimed either, because it still has an
> That's what happens in Visualworks, classes put in a WeakArray are
> never reclaimed.
> Fortunately, there is some Ephemeron support in VW to work around this
> (such loop are detected by ephemerons, and strong references by some
> object ephemerely pointed to does not count).
> In Squeak, I used a WeakValueDictionary, and to my surprise,
> discovered that the classes were reclaimed.
> Is this a bug?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev