1. Velocity
  2. VELOCITY-161

Object reference remains in SimplePool after sucessful get()


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1-rc2
    • Fix Version/s: None
    • Component/s: Engine
    • Labels:
    • Environment:
      Operating System: All
      Platform: All


      When using get() to checkout an object from the
      org.apache.velocity.util.SimplePool, the reference remains in the SimplePool
      and will only get released if the pool grows again to the peak level. The get
      () operation could be easily modified to place a null value in the object
      array location where the pooled item was removed so that if the object is not
      returned to the pool (for whatever reason including exceptions), the reference
      to the object does not remain in the pool until replaced in the stack-based
      design of the SimplePool. It's just good pool management for a reusable class.

      This became obvious when exceptions occured with the VelocityServlet
      mergeTemplate() and objects were not returned to the pool. Memory profiling
      showed references to VelocityWriter objects in the pool that were not released
      until activity increased to replace the reference in the SimplePool object
      array (and the memory could then be reclaimed).


        Bill Boland created issue -
        Jeff Turner made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 19042 12315031
        Mark Thomas made changes -
        Workflow jira [ 12325036 ] Default workflow, editable Closed status [ 12551323 ]
        Mark Thomas made changes -
        Assignee Velocity-Dev List [ ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12551323 ] jira [ 12552038 ]


          • Assignee:
            Bill Boland
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: