United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6763340 memory leak in com.sun.corba.se.* classes
JDK-6763340 : memory leak in com.sun.corba.se.* classes

Details
Type:
Bug
Submit Date:
2008-10-23
Status:
Closed
Updated Date:
2010-12-04
Project Name:
JDK
Resolved Date:
2009-09-21
Component:
other-libs
OS:
windows_xp
Sub-Component:
corba:orb
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0u16
Fixed Versions:
5.0u21-rev (b03)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
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.

                                    

Comments
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.
                                     
2008-10-29
SUGGESTED FIX

http://jpsesvr.sfbay.sun.com:8080/ctetools/html/ViewDetail.jsp?index=3047
                                     
2009-07-23
EVALUATION

http://hg.openjdk.java.net/jdk7/build/corba/rev/cff5a173ec1e
                                     
2010-12-04



Hardware and Software, Engineered to Work Together