Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-36

[pool] StackObjectPool.releaseObject(...) has silly behavior when the pool is full

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3
    • None
    • Operating System: All
      Platform: All

    • 34902

    Description

      StackObjectPool which is a LIFO pool discards newer pool objects when you call
      releaseObject(Object) on a full pool. Presumablly if you are using a
      StackObjectPool it is because the most recently added object is the most likely
      to be useful when you need another instance.

      In the current behavior (1.2) the pool is checked to see if it is maxed out when
      you try to release another object back into the pool (line 160). If it is the
      recently released object is discarded. Odds are the older objects pushed on to
      the pool stack are the most stale and lest useful but those are kept. This
      creates a situation where older objects are kept around despite their inferiority.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--TestStackObjectPool.java.patch
          3 kB
          Sandy McArthur (from Bugzilla import)
        2. ASF.LICENSE.NOT.GRANTED--StackObjectPool.java.patch
          1 kB
          Sandy McArthur (from Bugzilla import)
        3. ASF.LICENSE.NOT.GRANTED--StackObjectPool.java.javadoc.patch
          1 kB
          Sandy McArthur (from Bugzilla import)
        4. ASF.LICENSE.NOT.GRANTED--StackObjectPool.java.borrowObject.patch
          0.7 kB
          Sandy McArthur (from Bugzilla import)

        Activity

          People

            Unassigned Unassigned
            sandymac@apache.org Sandy McArthur (from Bugzilla import)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: