You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by "David J. M. Karlsen" <da...@davidkarlsen.com> on 2005/07/08 14:11:14 UTC

Eviction of pooled services

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: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Eviction of pooled services

Posted by belaran <be...@gmail.com>.
oh sorry... I misunderstood. : /


2005/7/8, James Carman <ja...@carmanconsulting.com>:
> 
>  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:belaran@gmail.com] 
> *Sent:* Friday, July 08, 2005 8:23 AM
> *To:* hivemind-user@jakarta.apache.org
> *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 <da...@davidkarlsen.com>:
> 
> 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: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>  
> 
> 
> 
> -- 
> Belaran,
> "What'do'ya mean ?"
> "As a moto, I just avoid meaning anything..." 
>  



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

Re: Eviction of pooled services

Posted by "David J. M. Karlsen" <da...@davidkarlsen.com>.
James Carman wrote:
> 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.

Right on! And what is the magical answer? :-)
Are they kept in a reference map or something? (eg. not a thread freeing 
on N ms idle time?)

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

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Eviction of pooled services

Posted by "David J. M. Karlsen" <da...@davidkarlsen.com>.
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:james@carmanconsulting.com]
> *Sent:* Friday, July 08, 2005 8:26 AM
> *To:* hivemind-user@jakarta.apache.org; '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:belaran@gmail.com]
> *Sent:* Friday, July 08, 2005 8:23 AM
> *To:* hivemind-user@jakarta.apache.org
> *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 <david@davidkarlsen.com 
> <ma...@davidkarlsen.com>>:
> 
> 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: hivemind-user-unsubscribe@jakarta.apache.org 
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org 
> <ma...@jakarta.apache.org>
> 
> 
> 
> 
> -- 
> 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: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


RE: Eviction of pooled services

Posted by James Carman <ja...@carmanconsulting.com>.
David,

 

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 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.

 

James

 

  _____  

From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Friday, July 08, 2005 8:26 AM
To: hivemind-user@jakarta.apache.org; '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:belaran@gmail.com] 
Sent: Friday, July 08, 2005 8:23 AM
To: hivemind-user@jakarta.apache.org
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 <da...@davidkarlsen.com>:

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: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org




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


RE: Eviction of pooled services

Posted by James Carman <ja...@carmanconsulting.com>.
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:belaran@gmail.com] 
Sent: Friday, July 08, 2005 8:23 AM
To: hivemind-user@jakarta.apache.org
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 <da...@davidkarlsen.com>:

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: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org




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


Re: Eviction of pooled services

Posted by belaran <be...@gmail.com>.
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 <da...@davidkarlsen.com>:
> 
> 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: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 
> 


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