You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2018/10/27 22:08:00 UTC
[jira] [Commented] (POOL-353) Return false if current connection
count is less then MinIdle in DefaultEvictionPolicy
[ https://issues.apache.org/jira/browse/POOL-353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16666226#comment-16666226 ]
Mark Struberg commented on POOL-353:
------------------------------------
Hi Jeffery!
I think the feature you want is already implemented!
Could you please take a look at the SoftMinEvictableIdleTimeMillis configuration and tell me if this is what you are looking for?
https://github.com/apache/commons-pool/blob/master/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java#L568
> Return false if current connection count is less then MinIdle in DefaultEvictionPolicy
> --------------------------------------------------------------------------------------
>
> Key: POOL-353
> URL: https://issues.apache.org/jira/browse/POOL-353
> Project: Commons Pool
> Issue Type: Improvement
> Affects Versions: 2.6.0
> Reporter: jefferyyuan
> Priority: Minor
> Fix For: 3.0, 2.6.1
>
>
> At [https://github.com/apache/commons-pool/blob/master/src/main/java/org/apache/commons/pool2/impl/BaseGenericObjectPool.java#L1140]
> It first evicts idle connections, then re-creates idle instances to ensureMinIdle.
> DefaultEvictionPolicy will close idle connection even when there is <= MinIdle connections.
> https://github.com/apache/commons-pool/blob/master/src/main/java/org/apache/commons/pool2/impl/DefaultEvictionPolicy.java
>
> In case minIdle is set to large, it would causes problems like frequent full GC.
> * the connection related objects are promoted and stored in old gen, then evict will close them and make it gc-able, and ensureMinIdle will create new connections which will be eventually promoted to old gen and gc-able again.
> * Old gen will grow quickly and need full gc.
> We can solve the problem if we always keep minIdle connections in the DefaultEvictionPolicy.
> Or at least add doc to DefaultEvictionPolicy and may provide another EvictionPolicy which returns false if current connection count is less then MinIdle and refer it in DefaultEvictionPolicy.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)