James Carman wrote:

Huh - your answer got into the mailqueue a minute before my question (see thread) :-)

To answer the question, I don’t think the service implementation object is ever really freed from the pool once it’s instantiated. The “pool” in this case is simply an ArrayList. The pooling algorithm is very rudimentary. Once the object is no longer needed by the current thread, it’s just added back to the pool. There’s nothing that I can tell that evicts idle objects from the pool. You could look into creating a more
If this is a "normal" arraylist (and not a soft-reference one) your conclusion is correct. And the model suits my application!

robust implementation by extending PooledServiceModel yourself or put an issue out in JIRA for it. I know that we’re reluctant to have too many dependencies for HM, so adding a dependency to commons-pool would probably be vetoed (but you’d have my vote). I’ve tried to suggest refactoring some of the code so that it uses commons-beanutils, but that was quickly rejected.
Maybe it's wise to "chunk up" hivemind a little?
A "core" implementation with few dependencies, and add-on modules which allow more dependencies? (Implementing interfaces / factories).




James

------------------------------------------------------------------------

*From:* James Carman [mailto:[EMAIL PROTECTED]
*Sent:* Friday, July 08, 2005 8:26 AM
*To:* [email protected]; 'belaran'
*Subject:* RE: Eviction of pooled services

-->

That’s not his question. He wants to know when the object will be freed/evicted from the pool so that it is even eligible for gc.

------------------------------------------------------------------------

*From:* belaran [mailto:[EMAIL PROTECTED]
*Sent:* Friday, July 08, 2005 8:23 AM
*To:* [email protected]
*Subject:* Re: Eviction of pooled services

As far as I understand the garbage collector, there is no real way to know. At some point, the garbage collector enters in action, degrades the perf but clean all object that are no longer referenced... Period. You cannot order it to clean this more quickly, you cannot clean yourself ( at least not the memory) and you don't really have control on it...

2005/7/8, David J. M. Karlsen <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:

Hi all!

How long will a pooled service instance be kept instanciated after being
released from a thread? (eg. idle time before freed/garbage collected)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>




--
Belaran,
"What'do'ya mean ?"
"As a moto, I just avoid meaning anything..."



--
David J. M. Karlsen - +47 90 68 22 43
http://www.davidkarlsen.com
http://mp3.davidkarlsen.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to