Issue Details (XML | Word | Printable)

Key: POOL-56
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Matt Bishop
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Pool

[pool] GenericObjectPool Evictor should be a TimerTask, not a Thread

Created: 10/Sep/05 05:14 AM   Updated: 14/Jul/06 11:26 AM
Return to search
Component/s: None
Affects Version/s: 1.2
Fix Version/s: 1.3

Time Tracking:
Not Specified

File Attachments:
  Size
Text File GenericObjectPools-TimerTask.patch 2006-02-13 04:53 AM Sandy McArthur (from Bugzilla import) 12 kB
Text File Timer.patch 2005-09-10 05:15 AM Matt Bishop 3 kB
Environment:
Operating System: All
Platform: All

Bugzilla Id: 36581


 Description  « Hide
Under most circumstances, an application will have one or two object pools, so
creating a new Evictor thread for each object is fine.

However, in the case of DBCP's PerUserDataSource class, this design is
unacceptable as it creates a thread for every distinct user that uses the data
source. In my case, our system has several thousand concurrent users, and as a
result, the system was attempting to create several thousand Evictor threads.

We fixed this by changing the Evictor from a Thread to a TimerTask which is
scheduled with the Timer class.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Matt Bishop added a comment - 10/Sep/05 05:15 AM
Created an attachment (id=16349)
Patch for GenericObjectPool.java

Sandy McArthur (from Bugzilla import) added a comment - 13/Feb/06 04:53 AM
Created an attachment (id=17671)
GenericObjectPools-TimerTask.patch

Updated and improved patch that applies to both GenericObjectPool and
GenericKeyedObjectPool. This patch is basicly the previously submitted one but:

  • applies to current SVN
  • Makes the java.util.Timer a daemon thread
  • Also patches GenericKeyedObjectPool
  • Shares the same Timer instance between the two pool types.