Results 1 to 5 of 5

Thread: Memory leak using RMI

  1. #1
    Join Date
    Nov 2004
    Posts
    7

    Default Memory leak using RMI

    I'm using the springframework for a server application that communicates with swing clients through RMI with the classes RMIServiceExporter on the server and the RmiProxyFactoryBean on the client side.

    I'm also using quartz and hibernate. The versions are:
    - 1.1.1 of Spring
    - 1.4.2 of quartz
    - 2.1.6 of Hibernate
    - And the JVM 1.4.2_06

    I've detected in this situation how the memory is increasing and with a MemoryDebugger utility I saw that some objects are never GCed. These objects are from the sun.reflect package and nobody references them:
    -BootstrapConstructorAccessorImpl
    -DelegatingClassLoader

    I've isolated the problem and when I don't publish the objects (ie. I donīt load the beans of RmiServiceExporter) the memory doesn't increase.
    If I start the server, publishing the objects, without clients the memory also increases.

    I've also tried to export all objects throgh a single class and the memory doesn't increase, but when I connect the clients I have the same problem.

    Any idea? Has anybody had this problem before?
    It's a good idea doing this connecion with another tecnology?

    Thanks

  2. #2
    Join Date
    Aug 2004
    Location
    Amsterdam, Netherlands
    Posts
    450

    Default

    As a workaround, you could use HttpInvokers or one of the other two remoeting technologies available (aside JaxRPc): Hessian or Burlap. The latter two are quite fast, they use a very thin serialization protocol (read the reference manual part on remoting, there are some guidelines to help you choose). I am running applications in production already for quite some time using all three of the technologies and so far, it's worked quite well!

    About the problem itself, could you try to publish the objects yourself and link them in using the Spring ProxyFactoryBean approach. You might want to have a look if the memory increase happens then as well... If not, than this is a Spring issue I guess...

    Exporting the objects yourself is nothing more than:

    Code:
    reg = LocateRegistry.getRegistry(portNo);
    UnicastRemoteObject.exportObject(yourService, servicePort);
    reg.rebind(name, yourService);
    Spring creates RmiInvocationWrappers to mimick the service implement Remote, so for this to work you'd have to have your interface extend Remote...

    regards,
    Alef
    Alef Arendsen
    SpringSource
    http://www.springsource.com

  3. #3

    Default

    Any feedback ? Have you resolved the problem ?

  4. #4
    Join Date
    Nov 2004
    Posts
    7

    Default Not yet

    I've made antoher solution to solve my problem.

    But the problem with RMI was not solved yet The memory increases and also the number of threads but this only hapens in some situations that i don't know.

  5. #5
    Join Date
    Feb 2006
    Posts
    17

    Default

    what solution did you choose?

    I also have the same setup, and i see memory increase over time. after some time the client machine slows down everything. restarting the swing app restores speed.

Similar Threads

  1. Memory Leak
    By Jim Reed in forum Container
    Replies: 15
    Last Post: Sep 30th, 2008, 02:49 PM
  2. Replies: 16
    Last Post: Nov 7th, 2005, 10:18 AM
  3. CGLIB memory leak?
    By moshebs in forum Container
    Replies: 1
    Last Post: Oct 2nd, 2005, 07:02 PM
  4. Memory leak problem with Spring app in tomcat
    By Mammux in forum Container
    Replies: 3
    Last Post: Sep 5th, 2005, 06:57 AM
  5. Possible memory leak with SLSB on WL5.1
    By skaffman in forum EJB
    Replies: 5
    Last Post: Aug 15th, 2005, 07:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •