[aida] get rid of the model when the server is stopped

Janko Mivšek janko.mivsek at eranova.si
Sat Dec 6 18:49:07 CET 2008

Herbert König wrote:

> when doing SwazooServer stop and closing the workspace in which the
> model was created, I don't get my model (anADemoAddressBook and its
> addresses) garbage collected. (AIDASite named: 'aidademo') stop
> doesn't help either.
> Hundreds of WebLinks and other web related objects pointing to them.
> How to get rid of them?

You need to unregister a model but also all other objects which were 
aoutomatically registered in UrlResolver. In tutorial case one instance 
of AddressBook and all instances of Address.

There is a convenience method in URLResolver to do that:

AIDASite default urlResolver
   removeObjectsOfClass: AddressBook;
   removeObjectsOfClass: Address.

But, Aida supposes that your model objects are permanent/relativelly 
stable and don't change on every server restart. If you regenerate your 
model at each restart or if your model objects are temporary, you need 
to remove them manually after you don't need them anymore:

self site urlResolver
    removeObject: yourTempObject

> Or more general, what keeps an image containing heavily browsed sites
> within memory limits when users leave the site?

If your model is permanent then most of memory goeas for the session 
application state, that is instances of your App classes. Because we 
don't timeout non-guest sessions, application state is permanent by 
default and you need to clean it manually from time to time, usually 
during the night.

You also have some convenient methods for that:

self site sessionManager
   removeNonactiveGuestSessions; "after 1h of inactivity"
   nilAppsForObjects "this cleans session application state"

Best regards

Janko Mivšek
Smalltalk Web Application Server

More information about the Aida mailing list