Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1530

TCPConnectionMap$TCPConnection$ConnectionPeerReceiver allocate and hold a 1.6G byte[]

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.3
    • 2.10
    • None

    Description

      In our application, after running a few hours of load test we will encounter OutOfMemoryError.

      It is caused by we use TCPPING with port_range and hit a JVM defect:
      http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=a8f3e6a330c28712870de27a7236?bug_id=6474129

      When we use TCPPING with port_range in some linux environments, the application can occasionally connect to a not listened local port.
      This socket will have the same local/destination port.
      If this connection is established, bytes written via this socket's OutputStream will be read from this socket's InputStream.

      In JGroups, a client socket will send cookie(

      { 'b', 'e', 'l', 'a' }

      ) as its first data and it will be read from the same socket's InputStream at TCPConnectionMap$TCPConnection$ConnectionPeerReceiver.

      This will allocation a 1.6G byte[] and hold it forever because the client socket won't read enough data in its whole life.

      I think a simple solution is to check the connected client socket is a self-connected(local/destination ip and port are the same) and retry next port when this happen.

      Attachments

        1. hold_by_jgroups.JPG
          hold_by_jgroups.JPG
          373 kB
        2. hold_by_jgroups.JPG
          hold_by_jgroups.JPG
          236 kB
        3. large_byte_array.JPG
          large_byte_array.JPG
          350 kB
        4. large_byte_array.JPG
          large_byte_array.JPG
          225 kB

        Issue Links

          Activity

            People

              rhn-engineering-bban Bela Ban
              krumlov.chiu Ken Chiu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: