Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-12790

Memory leak in camel-salesforce producer endpoint

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • fuse-7.6-CR1
    • fuse-7.5-GA
    • Camel
    • None
    • % %
    • +
    • Hide
      • Start this camel route. Please make sure that "toD" is used with cacheSize="-1" option to abvoid caching a producer object
        <routes id="routes-cceccf9a-bdf4-472e-abb2-f7ff41042c9e"
            xmlns="http://camel.apache.org/schema/spring"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
            <route autoStartup="true" id="_route1" trace="false">
                <from id="_to2" uri="timer:timerName?repeatCount=5"/>
                <setHeader headerName="name" id="_setHeader1">
                    <simple>${date:now:yyyyMMdd'T'HHmm}</simple>
                </setHeader>
                <toD id="_to1" uri="salesforce:getVersions" cacheSize="-1" />
                <log id="_log1" message=">>>>>camel-saleforce producer was executed"/>
                <onException id="_onException1">
                    <exception>java.lang.Exception</exception>
                    <log id="_log3" message="exception: ${exception}"/>
                </onException>
            </route>
        </routes>
        
      • After counting 5 times, run gc (ex:jcmd ${PID} GC.run)
      • Check number of DefaultRestClient objects (ex: jmap -histo ${PID} | grep DefaultRestClient)
        By invoking the producer endpoint 5 times, 5 DefaultRestClient objects are still remained in the heap
      Show
      Start this camel route. Please make sure that "toD" is used with cacheSize="-1" option to abvoid caching a producer object <routes id="routes-cceccf9a-bdf4-472e-abb2-f7ff41042c9e" xmlns="http://camel.apache.org/schema/spring" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <route autoStartup="true" id="_route1" trace="false"> <from id="_to2" uri="timer:timerName?repeatCount=5"/> <setHeader headerName="name" id="_setHeader1"> <simple>${date:now:yyyyMMdd'T'HHmm}</simple> </setHeader> <toD id="_to1" uri="salesforce:getVersions" cacheSize="-1" /> <log id="_log1" message=">>>>>camel-saleforce producer was executed"/> <onException id="_onException1"> <exception>java.lang.Exception</exception> <log id="_log3" message="exception: ${exception}"/> </onException> </route> </routes> After counting 5 times, run gc (ex:jcmd ${PID} GC.run) Check number of DefaultRestClient objects (ex: jmap -histo ${PID} | grep DefaultRestClient) By invoking the producer endpoint 5 times, 5 DefaultRestClient objects are still remained in the heap

    Description

      org.apache.camel.component.salesforce.internal.client.DefaultRestClient object is leaking during execution of camel-salesforce producer endpoint.
      SalesforceSession keeps RestClient(DefaultRestClient) object in SalesforceSession.listeners which is CopyOnWriteArraySet<SalesforceSessionListener>.
      To clean up RestClient object, SalesforceSession.removeListener() should be invoked, but neither org.apache.camel.component.salesforce.internal.processor.AbstractRestProcessor.process() nor 
      org.apache.camel.component.salesforce.internal.client.DefaultRestClient$DelegatingClientCallback.onResponse() does not take care for it.
      

      Attachments

        Issue Links

          Activity

            People

              ldemasi Luigi De Masi
              rhn-support-hfuruich Hisao Furuichi
              Tomas Veskrna Tomas Veskrna
              Federico Mariani
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: