You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Phil Steitz (Jira)" <ji...@apache.org> on 2025/11/04 15:24:00 UTC
[jira] [Commented] (POOL-350) Add option for not executing "hasBorrowWaiters()" while returning objects
[ https://issues.apache.org/jira/browse/POOL-350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18035361#comment-18035361 ]
Phil Steitz commented on POOL-350:
----------------------------------
I implemented the reuseOnReturn, reuseOnMaintenance solution in the 2_X branch in 5fef385ac68fa953e168e29c51cb28921ce4c316
> Add option for not executing "hasBorrowWaiters()" while returning objects
> -------------------------------------------------------------------------
>
> Key: POOL-350
> URL: https://issues.apache.org/jira/browse/POOL-350
> Project: Commons Pool
> Issue Type: New Feature
> Affects Versions: 2.6.0
> Environment: h5. uname -a:
> Linux VMS26239 3.10.0-229.11.1.el7.x86_64 #1 SMP Thu Aug 6 01:06:18 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
>
> *Java version:*
> java version "1.8.0_60"
> Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
> Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
>
>
> Reporter: zhu chen
> Priority: Critical
> Labels: easyfix
> Fix For: 2.12.2
>
>
> h2. Phenomena:
> I'm recently leveraging commons-pool as my Redis connection pool in my project, however, the pain is that when my system is dealing with over thousands of Redises, CPU load become such high. By checking JVM through JFR(FlightRecorder), it turned out the hot method was "{color:#FF0000}hasBorrowWaiters(){color}", which is invoked by "{color:#FF0000}returnObject(){color}" each time.
> That means the system will go through over *thousands*(the number will grow as well as my system) of keys after *each* object's *return*, what's worse, the program is running concurrently, which, obviously cause a huge CPU load.
>
> h2. Expect:
> I was wondering if we could add a config for optionally run this "hasBorrowWaiters()" each time when we return an object.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)