[jboss-jira] [JBoss JIRA] (JGRP-1530) TCPConnectionMap$TCPConnection$ConnectionPeerReceiver allocate and hold a 1.6G byte[]

Bartosz --- (JIRA) issues at jboss.org
Wed Jul 4 17:56:00 EDT 2018


    [ https://issues.jboss.org/browse/JGRP-1530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13601337#comment-13601337 ] 

Bartosz --- commented on JGRP-1530:
-----------------------------------

The memory leak described in this ticket may still occur if the bind IP address passed to the client socket is null and the resulting source and destination addresses are equal. This is because the local IP address of the client socket after binding and before connecting to the remote server is 0.0.0.0 and it differs from the destination IP address. After connecting the local IP address is being updated to the actual value.
I've commited a [pull request|https://github.com/belaban/JGroups/pull/391].

> TCPConnectionMap$TCPConnection$ConnectionPeerReceiver allocate and hold a 1.6G byte[]
> -------------------------------------------------------------------------------------
>
>                 Key: JGRP-1530
>                 URL: https://issues.jboss.org/browse/JGRP-1530
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 2.10
>         Environment: Linux (2.6.18-308.13.1.el5)
> Java HotSpot(TM) 64-Bit Server VM (20.10-b01, mixed mode)
>            Reporter: Ken Chiu
>            Assignee: Bela Ban
>             Fix For: 3.3
>
>         Attachments: hold_by_jgroups.JPG, hold_by_jgroups.JPG, large_byte_array.JPG, large_byte_array.JPG
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list