get rid of the model when the server is stopped

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

get rid of the model when the server is stopped

Herbert König
Hello,

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?

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

Cheers,

Herbert                          mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: get rid of the model when the server is stopped

Janko Mivšek
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

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida