Uploaded image for project: 'ServiceMix Components'
  1. ServiceMix Components
  2. SMXCOMP-119

LockManager impl causes memory leak in ServiceMix EIP

    XMLWordPrintableJSON

Details

    Description

      Currently the org.apache.servicemix.locks.LockManager interface only has a single method getLock() associated with it. As a result this can cause excessive memory leaks in any component that uses it. I noticed this problem after upgrading our ServiceMix version (from 3.2.1 to 3.3.1.8-fuse) when using the ServiceMix EIP. There was a change made for SM-1444 to start using the lockManager instance in the base EIPEndpoint class to store a lock for each exchange correlation id. As a result a new lock is being leaked for each unique correlation id. In our particular use case we see a 1-to-1 correlation of one object in the lockManager for each message sent to the static recipient list. After some period of time our ServiceMix crashes with an OutOfMemoryError. I provided a link to the changeset as reference.

      see:
      http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-eip/trunk/src/main/java/org/apache/servicemix/eip/patterns/StaticRecipientList.java?r1=669611&r2=674844&diff_format=h

      Class that use LockManager and may be affected:
      FtpPollerEndpoint.java
      FilePollerEndpoint.java
      TrueZipPollerEndpoint.java
      AbstractAggregator.java
      EIPEndpoint.java

      Attachments

        1. sm-1792-truezip.patch
          1 kB
          Ron Gavlin
        2. sm-1792-ftp.patch
          0.5 kB
          Ron Gavlin
        3. sm-1792-file.patch
          0.5 kB
          Ron Gavlin
        4. sm-1792-eip.patch
          9 kB
          Ron Gavlin
        5. sm-1792-common.patch
          0.9 kB
          Ron Gavlin
        6. SM-1792.diff
          2 kB
          Trevor Pounds

        Activity

          People

            ffang Freeman Yue Fang
            tpounds Trevor Pounds
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: