Hi Joachim,
the Behavior>>flushCache method, primitive 89, flushes the entire cache, so its all you need. There are alternative primitives that flush selectively, i.e. Symbol>>flushCache, primitive 119, and CompiledMethod>>flushCache, primitive 116, flush only entries for the receivers.
HTH
Eliot
On Thu, May 20, 2010 at 10:52 AM, Stéphane Ducasse
<[hidden email]> wrote:
Begin forwarded message:
> From: Joachim Geidel <[hidden email]>
> Date: May 20, 2010 6:31:51 PM GMT+02:00
> To: <[hidden email]>
> Subject: [Pharo-users] Flushing the VM method cache?
> Reply-To: A friendly place where any question about pharo is welcome <[hidden email]>
>
> Hello all,
>
> The software I am working on generates classes on the fly, and discards
> those classes when they are no longer needed. The class library is
> cross-platform, i.e. it exists for Dolphin and VisualWorks, and I am
> currently porting it to Pharo.
>
> In Dolphin, it is necessary to flush the VM's method cache after discarding
> all the dynamically generated classes, because the method cache holds
> references to the classes which prevent them from being garbage collected.
> For VisualWorks, I have adopted this, although I am not quite sure if it's
> actually needed there.
>
> In the Pharo 1.0 image, I haven't found a method for flushing the VM's
> method cache in one go, there only seems to be Behavior>>flushCache.
>
> What I would like to know is:
> - Does the VM method cache of the Squeak VM hold references to classes which
> prevent an obsolete class from being garbage collected? If this is not the
> case, I don't need to flush anything.
> - If flushing the cache is advisable, is Behavior>>flushCache the only way
> to do this? I would have to pick up all the obsolete classes and iterate
> over them in that case.
>
> Thanks in advance!
> Joachim Geidel
>
>
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project