OutOfMemory Errors after stopping and starting Enterprise Applications
 Technote (troubleshooting)
 
Problem(Abstract)
Under certain circumstances, an enterprise application (EAR) is stopped, but objects are not cleared from the heap. These objects could later contribute to OutOfMemory errors.
 
Cause
Objects typically remain on the heap until all references to them are nullified and the JVM executes a Garbage Collection cycle. However, objects having a finalizer may not be removed from the heap during this Garbage Collection cycle. These objects remain in the heap until all references to them are nullified, the finializer thread runs (the objects are finalized,) and the JVM executes a subsequent Garbage Collection cycle.
 
Resolving the problem
When the JVM has enough activity to execute frequent Garbage Collection cycles, objects having a finalizer will not collect on the heap over time. In other circumstances, it may be necessary to manually execute Finalization and Garbage Collection to prevent potential OutOfMemory errors.

In the event that the JVM throws an OutOfMemoryError when successively restarting an enterprise application (EAR), the following procedure should resolve this issue.

  1. Stop the EAR

  2. Execute the following code from a servlet or JSP in a different EAR in the same JVM:

    System.gc();
    System.runFinalization();

  3. Start the EAR.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Out of Memory
Operating system(s): Windows
Software version: 5.1.1.2
Software edition:
Reference #: 1192606
IBM Group: Software Group
Modified date: Aug 26, 2008