Can I get a notification before fullGC?
Georg Gollmann
gollmann at zid.tuwien.ac.at
Thu Oct 12 08:13:18 UTC 2006
Am 12.10.2006 um 04:18 schrieb Bert Freudenberg:
> Am 12.10.2006 um 03:59 schrieb Yoshiki Ohshima:
>
>> Is there any way to get some sort of notification right *before* a
>> fullGC happens so that some guys release their cache?
>
> Not that I know of.
>
>> ... releases the cache only when a big memory clean up is
>> required.
>
> You could add it to the memoryHogs list ...
>
> - Bert -
Yes, that is exactly the scenario I had in mind way back then (2000):
> The current LowSpaceWatcher just alerts the user. This is not
> useful for servers or for situations when objects are cached and
> should be discarded when space becomes tight. I have now
> generalized the mechanism used in my MailArchiver (http://
> macos.tuwien.ac.at/Squeak/mailArchiver.html).
>
> As an example setup is now:
>
> Smalltalk memoryHogs add: ArchivedMail
>
> When space is low #freeSomeSpace gets sent:
>
> ArchivedMail>freeSomeSpace
> "Remove all cached text from my instances."
> self allInstancesDo: [ :m | m purgeText ]
>
>
> If freeSomeSpace fails to free enough memory - maybe because no
> memoryHogs have been registered - the old behavior (alert the user)
> is invoked.
I don´t know, if the stuff still works in the current Squeak version,
however...
Kind regards
Georg
More information about the Squeak-dev
mailing list
|