[squeak-dev] Re: [Pharo-project] Fwd: [Pharo-users] Flushing the VM method cache?

Eliot Miranda eliot.miranda at gmail.com
Thu May 20 18:21:19 UTC 2010


On Thu, May 20, 2010 at 11:13 AM, Eliot Miranda <eliot.miranda at gmail.com>wrote:

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

And the VM does selectively flush the cache on GC anyway, so you shouldn't
have to do anything.


>
> HTH
> Eliot
>
> On Thu, May 20, 2010 at 10:52 AM, Stéphane Ducasse <
> stephane.ducasse at inria.fr> wrote:
>
>>
>>
>> Begin forwarded message:
>>
>> > From: Joachim Geidel <joachim.geidel at onlinehome.de>
>> > Date: May 20, 2010 6:31:51 PM GMT+02:00
>> > To: <pharo-users at 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 at 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 at lists.gforge.inria.fr
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project at lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100520/3c36a164/attachment.htm


More information about the Squeak-dev mailing list