Memory leak due to ORB and IDLListenerThreads not being reused on subsequent HTTPRequests to a servlet that commnicates with a Lotus Domino Server

Technote (FAQ)
Problem
When customer's application using IIOP to acess domino server, each time a user connects( ie. access the servlet), a new port will be opened and is used as CORBA listener port. Those ports will be in listening mode and not get clean up, eventually the application will use up the network ports.
Cause
When remotely accessing a Lotus Domino Server using the NCSOW.jar from a WebSphere Servlet/JSP, WebSphere's JavaIDL listener threads are not cleaned up after each completion of the servlet request. This causes a memory leak in the WebSphere Application Server. The root cause is the listener threads have not released its resources back to the current ORB object, while the ORB object is waiting on these listeners to complete before it can be terminate and release all the objects it has referenced.

When a user re-invokes servlet by refreshing the browser, a new ORB and JavaIDL listeners are being created. Meanwhile, the existing ORB and JavaIDL listeners are still sitting there and waiting for a client's incoming call. As a result, the existing ORB and JavaIDL listener threads were not being removed and new ORB and JavaIDL listener threads are being created. The ORB and JavaIDL listeners will eventually use up all of the available memory and the JVM will throw a java.lang.OutOfMemoryError the heap is exhausted.

Solution
Use a single static ORB instance in jsps and servlets that communicate with a Lotus Domino Server.

For example:
....
static org.omg.CORBA.ORB singleORB = null;
java.util.Properties props = new java.util.Properties();
props.put("org.omg.CORBA.ORBClass", "com.ibm.rmi.iiop.ORB");

if (singleORB == null)
singleORB = ORB.init( (String[]) null, (java.util.Properties) props);
lotus.domino.NotesFactory.createSession( String host, org.omg.CORBA.ORB
orb, String user, String password )

//please contact Lotus support for correct usage of this API











    Document Information

    Product categories: Software, Application Servers, Distributed Application & Web Servers, WebSphere Application Server
    Operating system(s): Multi-Platform
    Software version: 3.5, 4.0, 5.0, 5.1, 6.0
    Reference #: 1127523
    IBM Group: Software Group
    Modified date: 2003-08-27