Carsten Ziegeler wrote:

Unico Hommes wrote:

You can't rely on the fact that recycle() is always called on your component.
The current implementations ECM and Fortress, don't do this under heavy load.
The approach using the request data store is reliable.

Woah, that is good to know. Is this considered a bug? I don't think I ever experienced a problem with this.


No, this is not considered a bug. Recycle is only called when the instance is really recycled. Example: if you have a limited pool, with let's say maximum 128 instances. If all this 128 instances are in use, but another one is needed, a new is created but not added to the pool. So when this component is released, recycle() is not called as the component is not pooled. The instance is handled over to the GC.

This is the way it works with ECM.


Just a point of further clarification with Fortress:

THe Fortress pool will continue to grow under heavy load, as there is no
true maximum.  During periods of light load, the pool is then purged to
more reasonable levels.  There is a process that runs periodically to
detect these things.  When the pool size is below a certain threshold (i.e.
under such heavy load that there are no more instances available) the
background process will create more instances.  The pool will still create
what it needs on demand--but this background process will create more than
one instance at a time.  When the pool size grows beyond that threshold
(i.e. the load is down and all the instances are being returned), the
background process will start disposing of the excess.

So yes, it is possible (and likely) that you will have components created
and destroyed without being recycled--but not as strictly as the old ECM
manner.

--

"They that give up essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety."
                - Benjamin Franklin



Reply via email to