Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 5055 invoked from network); 29 Oct 2008 11:16:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Oct 2008 11:16:36 -0000 Received: (qmail 81579 invoked by uid 500); 29 Oct 2008 11:16:40 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 81528 invoked by uid 500); 29 Oct 2008 11:16:40 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 81517 invoked by uid 99); 29 Oct 2008 11:16:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Oct 2008 04:16:40 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Oct 2008 11:15:34 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5DFD6234C24A for ; Wed, 29 Oct 2008 04:15:44 -0700 (PDT) Message-ID: <357017172.1225278944383.JavaMail.jira@brutus> Date: Wed, 29 Oct 2008 04:15:44 -0700 (PDT) From: "Torsten Feig (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (POOL-130) GenericObjectPool.Evictor creates new objects although exactly minIdle objects are idle In-Reply-To: <1675077114.1223304704548.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/POOL-130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643467#action_12643467 ] Torsten Feig commented on POOL-130: ----------------------------------- In my case, the creation is probably not very expensive, but the outcome is ugly anyway: we use GenericObjectPool as a thread pool. Every object created is a thread with a unique name (basename + incremented counter) so to tell them apart (in logs or threaddumps). We'd like to have 10 minIdle threads for a quick response to average workload. When the application runs a while (i.e. for days), there may however be no work for these threads at all. So the operations department frowns when looking into the logs and seeing ridiculously high thread counters. I haven't looked into the source code and can therefor not provide a patch. But it appears to me that it should be quite simple as this "churn" of idle objects seems to be an additional functionality - just cut out the code that destroys und recreates idle objects. > GenericObjectPool.Evictor creates new objects although exactly minIdle objects are idle > --------------------------------------------------------------------------------------- > > Key: POOL-130 > URL: https://issues.apache.org/jira/browse/POOL-130 > Project: Commons Pool > Issue Type: Bug > Affects Versions: 1.2, 1.4 > Reporter: Torsten Feig > > When you > - create a GenericObjectPool with these parameters: maxActive=100, maxIdle=100, minIdle=10, timeBetweenEvictionRunsMillis=360000 (1h), minEvictableIdleTimeMillis=30000 (5min) > - preload the 10 minIdle objects (10x borrowObject() + returnObject) > you have a pool with 10 idle objects. > Then every 1h the evictor destroys the 10 idle objects and creates 10 new ones. Why? After all, creating and tearing down pool objects is likely to be expensive. So why destroy the old objects when they exactly represent the minIdle objects? I don't see any need for this. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.