-
Bug
-
Resolution: Fixed
-
P2
-
6u14
-
b08
-
x86
-
windows_xp
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2185581 | 7 | Sunita Koppar | P4 | Resolved | Fixed | b123 |
JDK-2186670 | 6u19 | Sunita Koppar | P2 | Resolved | Fixed | b01 |
JDK-2189231 | 6u18-rev | Sunita Koppar | P2 | Resolved | Fixed | b09 |
JDK-2192868 | 5.0u25 | Sunita Koppar | P3 | Closed | Fixed | b01 |
JDK-2190173 | 5.0u24-rev | Sunita Koppar | P3 | Resolved | Fixed | b04 |
JDK-2185541 | 5.0u23-rev | Sunita Koppar | P3 | Resolved | Fixed | b04 |
$ more Example.idl
interface Example
{
};
and compiled it with.
$ idlj -verbose Example.idl
Parsing Example.idl
done - Example.idl
Generating Example
done - Example
created the following files
$ ls
ExampleHelper.java Example.idl ExampleOperations.java
ExampleHolder.java Example.java _ExampleStub.java
The customer explains the issue is with _ExampleStub.java
$ more _ExampleStub.java
/**
* _ExampleStub.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from Example.idl
* Monday, October 19, 2009 3:13:55 PM PDT
*/
public class _ExampleStub extends org.omg.CORBA.portable.ObjectImpl implements Example
{
// Type-specific CORBA::Object operations
private static String[] __ids = {
"IDL:Example:1.0"};
public String[] _ids ()
{
return (String[])__ids.clone ();
}
private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
{
String str = s.readUTF ();
String[] args = null;
java.util.Properties props = null;
org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
_set_delegate (delegate);
}
private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
{
String[] args = null;
java.util.Properties props = null;
String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
s.writeUTF (str);
}
} // class _ExampleStub
The readObject() generates an ORB which stays in the heap. It is not gc'd. This causes the OOM error in the customer's program. The customer says a similar problem exists with writeObject(). They explain that the problem with these methods is that they cause an ORB to be created. In some cases they created a threadpool and even had threads running. In customer's case these threads prevented GC of his classLoader. He strongly feels serialization should not be creating ORBs. If it is required that an ORB be created, they should be completely destroyed and ensure that all threads have exited.
- backported by
-
JDK-2186670 memory leak in readObject() and writeObject() using idlj from jdk 1.6.0_14
- Resolved
-
JDK-2189231 memory leak in readObject() and writeObject() using idlj from jdk 1.6.0_14
- Resolved
-
JDK-2185541 memory leak in readObject() and writeObject() using idlj from jdk 1.6.0_14
- Resolved
-
JDK-2190173 memory leak in readObject() and writeObject() using idlj from jdk 1.6.0_14
- Resolved
-
JDK-2185581 memory leak in readObject() and writeObject() using idlj from jdk 1.6.0_14
- Resolved
-
JDK-2192868 memory leak in readObject() and writeObject() using idlj from jdk 1.6.0_14
- Closed