instances of WAComponent

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

instances of WAComponent

Luc Damas

Hi all,

I have a seaside application with a root component, rendering some
components, themselves rendering components...

When I want to render a component (children), I do not create a new
instance: my parent component have an instance variable of the component
to render.

I don't use:

WAX>> renderContentOn: html
        self component: (WAY new with: anObject).
        html render: self component

but:

WAX>> renderContentOn: html
        self component isNil ifTrue: [ self component: WAY new ].
        self component with: anObject.
        html render: self component


Why do I use this solution? Because the garbage collector (VW) does not
remove old instances (unreferenced). When instances of WAComponent are
big, the image grows, grows... Each sessions contains components... When
there is a lot of users (sessions), there is much more components!
Server falls unusable! :-(

My questions are:
- How do you manage subcomponents? new each time or instance variable?
- Does anybody test seaside with a lot of users (100, 1000, 10000...)


Cheers,
Luc, Seaside lover!

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: instances of WAComponent

Bany, Michel
> Why do I use this solution? Because the garbage collector
> (VW) does not remove old instances (unreferenced). When
> instances of WAComponent are big, the image grows, grows...

The VW garbage collector *does* remove the unreferenced instances,
it just does not tell you when.

> Each sessions contains components... When there is a lot of
> users (sessions), there is much more components!
> Server falls unusable! :-(

You can get rid of expired sessions using this :

Seaside.WARegistry allGeneralInstances do: [:ea | ea
unregisterExpiredHandlers]

To prevent the image growth, you may want to execute the above
every now and then.  

You may also want to give more memory to VW. The default is 160MB, a bit
small
for a Seaside server.

DefaultMemoryUpperBound := 500 * 1000000. "500MB"
DefaultGrowthRegimeUpperBound := 100 * 1000000.  "100MB"
DefaultFreeMemoryUpperBound := 50 * 1000000. "50MB"
ObjectMemory installMemoryPolicy: self new setDefaults.

HTH,
Michel.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: instances of WAComponent

Bany, Michel
In reply to this post by Luc Damas
Oops !

> ObjectMemory installMemoryPolicy: MemoryPolicy new setDefaults.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: instances of WAComponent

Dmitry Dorofeev
In reply to this post by Bany, Michel
In Squeak I do this once per day on a production Seaside server:

WARegistry clearAllHandlers.
MCFileBasedRepository flushAllCaches.
Smalltalk garbageCollect.

Just to clear memory of Seaside things.
-Dmitry.

Bany, Michel wrote:

>>Why do I use this solution? Because the garbage collector
>>(VW) does not remove old instances (unreferenced). When
>>instances of WAComponent are big, the image grows, grows...
>
>
> The VW garbage collector *does* remove the unreferenced instances,
> it just does not tell you when.
>
>
>>Each sessions contains components... When there is a lot of
>>users (sessions), there is much more components!
>>Server falls unusable! :-(
>
>
> You can get rid of expired sessions using this :
>
> Seaside.WARegistry allGeneralInstances do: [:ea | ea
> unregisterExpiredHandlers]
>
> To prevent the image growth, you may want to execute the above
> every now and then.  
>
> You may also want to give more memory to VW. The default is 160MB, a bit
> small
> for a Seaside server.
>
> DefaultMemoryUpperBound := 500 * 1000000. "500MB"
> DefaultGrowthRegimeUpperBound := 100 * 1000000.  "100MB"
> DefaultFreeMemoryUpperBound := 50 * 1000000. "50MB"
> ObjectMemory installMemoryPolicy: self new setDefaults.
>
> HTH,
> Michel.
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside