Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.6.2, 2.0-M3
    • Component/s: camel-core, jmx
    • Labels:
      None
    • Environment:

      WinXP, Java 1.6

      Description

      There seems to be a memory leak if you are using recipientList and JMX enabled. The problem is that endpoint MBean name computed by using hashCode, if there is lot of different endpoints (created on runtime) every new endpoint will create a new MBean instance.
      Also in recipientList every entry will create new endpoint.
      In example if we have 3 urls ;
      http://host/index?id=1
      http://host/index?id=2
      http://host/index?id=3
      Camel will add 3 different MBeans entry to JMX. As url parameters are normally unique then camel will end up with creating thousands of endpoint entries. But every MBean takes memory.

      1. Picture 1.png
        26 kB
        Claus Ibsen
      2. MemLeak.java
        1 kB
        Andres
      3. JConsole.jpg
        231 kB
        Andres

        Activity

        Jeff Turner made changes -
        Project Import Sat Nov 27 00:14:50 EST 2010 [ 1290834890113 ]
        Claus Ibsen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Claus Ibsen added a comment -

        Closing all 2.0M3 tickets

        Show
        Claus Ibsen added a comment - Closing all 2.0M3 tickets
        Hadrian Zbarcea made changes -
        Fix Version/s 2.0-M3 [ 12160 ]
        Fix Version/s 2.0.0 [ 11900 ]
        Claus Ibsen made changes -
        Attachment Picture 1.png [ 18163 ]
        Hide
        Claus Ibsen added a comment -

        jconsole with Camel 1.6.2 showing that the http endpoints is only registered once.

        Show
        Claus Ibsen added a comment - jconsole with Camel 1.6.2 showing that the http endpoints is only registered once.
        Claus Ibsen made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 1.6.2 [ 12140 ]
        Status Reopened [ 4 ] Resolved [ 5 ]
        Hide
        Claus Ibsen added a comment -

        Fixed by CAMEL-1771

        Show
        Claus Ibsen added a comment - Fixed by CAMEL-1771
        Hide
        Claus Ibsen added a comment -

        The direct component does not have its consumer named nicely as its an anonymous inner class. I am fixing this.

        Show
        Claus Ibsen added a comment - The direct component does not have its consumer named nicely as its an anonymous inner class. I am fixing this.
        Hide
        Claus Ibsen added a comment -

        Its kinda like the issue with seda component as well.

        We should have a new method on Endpoint to compute a key for the JMX bean to use.
        getEndpointKey()
        Then all your http endpoints can share the same JMX bean.

        But each endpoint is registered individually in the endpoint cache as they are different as they have a different id parameter.

        Thanks for the unit test. It uses about 50mb more memory with or without the patch on my laptop.

        Show
        Claus Ibsen added a comment - Its kinda like the issue with seda component as well. We should have a new method on Endpoint to compute a key for the JMX bean to use. getEndpointKey() Then all your http endpoints can share the same JMX bean. But each endpoint is registered individually in the endpoint cache as they are different as they have a different id parameter. Thanks for the unit test. It uses about 50mb more memory with or without the patch on my laptop.
        Hide
        Claus Ibsen added a comment -

        I guess some endpoints should not consider parameters and others should as they could differ.

        The http should obviously not consider parameters.

        Show
        Claus Ibsen added a comment - I guess some endpoints should not consider parameters and others should as they could differ. The http should obviously not consider parameters.
        Claus Ibsen made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Duplicate [ 3 ]
        Hide
        Claus Ibsen added a comment -

        Sorry this is JMX registering new endpoints all the time

        Show
        Claus Ibsen added a comment - Sorry this is JMX registering new endpoints all the time
        Claus Ibsen made changes -
        Resolution Duplicate [ 3 ]
        Assignee Claus Ibsen [ davsclaus ]
        Fix Version/s 2.0.0 [ 11900 ]
        Fix Version/s 2.1.0 [ 12002 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Claus Ibsen added a comment -

        Duplicate of CAMEL-1771

        Show
        Claus Ibsen added a comment - Duplicate of CAMEL-1771
        Andres made changes -
        Link This issue is related to CAMEL-1771 [ CAMEL-1771 ]
        Claus Ibsen made changes -
        Component/s jmx [ 11650 ]
        Fix Version/s 2.1.0 [ 12002 ]
        Hide
        Claus Ibsen added a comment -

        Thanks for reporting.

        JMX is scheduled for an overhaul in Camel 2.1

        Show
        Claus Ibsen added a comment - Thanks for reporting. JMX is scheduled for an overhaul in Camel 2.1
        Hide
        Andres added a comment -

        Temporary workaround that works for me is to overwrite CamelNamingStrategy via custom lifecycleStrategy bean.

        My custom CamelNamingStrategy overwrites getEndpointId and computes EndpointId so that url parameters not considered.

        Show
        Andres added a comment - Temporary workaround that works for me is to overwrite CamelNamingStrategy via custom lifecycleStrategy bean. My custom CamelNamingStrategy overwrites getEndpointId and computes EndpointId so that url parameters not considered.
        Andres made changes -
        Attachment JConsole.jpg [ 18132 ]
        Hide
        Andres added a comment -

        JConsole picture

        Show
        Andres added a comment - JConsole picture
        Andres made changes -
        Attachment MemLeak.java [ 18131 ]
        Hide
        Andres added a comment -

        Example class to reproduce problem

        Show
        Andres added a comment - Example class to reproduce problem
        Andres made changes -
        Field Original Value New Value
        Priority Major [ 3 ] Minor [ 4 ]
        Andres created issue -

          People

          • Assignee:
            Claus Ibsen
            Reporter:
            Andres
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development