Uploaded image for project: 'Jackrabbit JCR-RMI'
  1. Jackrabbit JCR-RMI
  2. JCRRMI-28

Leaking ServerEvent objects after RMI connection loss

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 1.6.0, 2.1.0
    • 1.6.0
    • None
    • Windows 7 Pro x64

      32Bit Java VM
      java version "1.6.0_20"
      Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
      Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)

    Description

      When an RMI connection is crashes, or the client is terminated without calling "session.logout()", the server leaks ServerEventCollection$ServerEvent objects.

      Attached is a zip with two java programs that demonstrate the behaviour. Steps to reproduce:

      • Open a cmd shell
      • cd jcrserver
      • mvn compile
      • SET MAVEN_OPTS=-Djava.rmi.dgc.leaseValue=10000 && mvn exec:java -Dexec.mainClass=RMIServer
      • Open another cmd shell
      • cd jcrrmiclient
      • mvn compile
      • mvn exec:java -Dexec.mainClass=RMIClient

      Watch the heap:

      • Start VisualVM (you'll need the VisualVM-Sampler plugin)
      • Go to the RMIServer process.
      • Open the "Sampler" tab and sample "Memory".
      • In the filter enter "ServerEvent".

      You'll now see the number of ServerEvents (also _Stub and _Skel) steadily increasing.

      • Quit the RMIClient using Ctrl-C.

      The number of ServerEvents is still increasing, even after the RMI lease time expires.

      If, instead of being killed, the client calls "session.logout()", the server stops producing new ServerEvent instances.

      Attachments

        1. RMI-Test.zip
          10 kB
          Jens Theess
        2. jcr-rmi.patch
          1 kB
          Jens Theess

        Activity

          People

            Unassigned Unassigned
            jenstheess Jens Theess
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: