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 < stephane.ducasse@inria.fr> wrote:
Begin forwarded message:
From: Joachim Geidel <joachim.geidel@onlinehome.de> Date: May 20, 2010 6:31:51 PM GMT+02:00 To: <pharo-users@lists.gforge.inria.fr> Subject: [Pharo-users] Flushing the VM method cache? Reply-To: A friendly place where any question about pharo is welcome < pharo-users@lists.gforge.inria.fr>
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 Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project