JDK-6763340 : memory leak in com.sun.corba.se.* classes
  • Type: Bug
  • Component: other-libs
  • Sub-Component: corba:orb
  • Affected Version: 5.0u16
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-10-23
  • Updated: 2010-12-04
  • Resolved: 2009-09-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other Other JDK 6 JDK 7
5.0u21-rev b03Fixed 5.0u22-revFixed 5.0u23Fixed 6u16-revFixed 7Fixed
Related Reports
Relates :  
Customer reports a memory leak with a WebLogic app with 1.5.0_16. Histograms shows several classes continuously growing over time. These classes include weblogic.corba.client.utils.EndPointInfo and several com.sun.cobra.se.impl.* classes. The heap dump shows EndPointInfo is held by reference by com.sun.corba.se.impl.legacy.connection.SocketFactoryContactInfoImpl

References to SocketFactoryContactInfoImpl were more com.sun.cobra.se.impl.* classes. Going further up the stack, I found these com.sun classes were referencing each other in a circular fashion.

I looked at one particular instance of com.sun.corba.se.impl.legacy.connection.SocketFactoryConnectionImpl. There are over 8800 references to this instance. Here are some of the references.

com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl@0x1d1b75d8 (85 bytes) : field connection
com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl@0x1da72108 (85 bytes) : field connection
com.sun.corba.se.impl.encoding.CDRInputObject@0x22062df8 (37 bytes) : field corbaConnection
com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl@0x1aba53a0 (85 bytes) : field connection 

Here a two relevant bugs, 6725987 and 6553303. Could they be the source of this problem?

CR 6725987 says ORB.destroy() does not cleanup correctly and ORB object instances are not garbage collected.

The evaluation for CR 6553303 says one part of this problem is clear: if the ORB successfully opens a connection, but sometime later the connection is no longer usable, it gets stuck in the cache.
The customer reported that this issue only happens with JDK 1.5. There is no problem on JDK 1.4.2. They also report the issue happens with JDK 1.5 only when IOP is used. The webapp runs fine on JDK 1.5 with TCP.

EVALUATION http://hg.openjdk.java.net/jdk7/build/corba/rev/cff5a173ec1e

SUGGESTED FIX http://jpsesvr.sfbay.sun.com:8080/ctetools/html/ViewDetail.jsp?index=3047

EVALUATION While cyclic references themselves do NOT cause leaks, there were other problems that did cause memory leaks, notably some issues with ThreadLocals, and some transport resources that were not properly freed. This bug appears to be simply another manifestation of the problems that we fixed in 6725987. The fixes for that bug are/will be available in (according to 6725987) in 6u12 and 5.0u20. I suggest that you re-test for this problem with those releases. If there are any other issues (such as the WebLogic endpoint info in the LegacySocketFactory, which was not part of the test for 6725987) please update this bug or file a new bug.