Troubleshooting Out Of Memory Errors in Weblogic using Eclipse Memory Ananlyser

Eclipse Memory Ananlyser is a very useful tool to analyze heap dumps. It has a lot of features such as Memory Leak detection where it runs an automated test to determine the suspected leaks.

Here is the Procedure

Step 1). Start the Weblogic Server, with the application in active state which causes memory leak.

Step 2). Get the process id of the server using jps


Step 3). Acess the application that causes memory leak

Step 4).Take heap dump at regular interval using jmap.

jmap -dump:format=b,file=dump1.bin 5004

Step 5).Open the Heap Dump in Eclipse Memory Ananlyzer (U can download it from http://www.eclipse.org/mat/downloads.php) Approximate size is 42 MB..Just u need to extract this Zip then u can directly start (no Installation needed)

Observe the heap usage of Objects in the heap dumps. If the object instance keeps on increasing in the subequent heap dumps, force a garbage collection from the Weblogic Server console


Take heap dumps again and open in the Eclipse Memory Analyzer. If the number of instances still don’t go down for those objects, you can expect to see this

<Jul 16, 2010 10:49:15 AM IST> <Critical> <Health> <BEA-310003> <Free memory in
the server is 47,856 bytes. There is danger of OutOfMemoryError>
Exception in thread “Thread-12” java.lang.OutOfMemoryError: Java heap space
at demo.MemoryLeakTest.runTest(MemoryLeakTest.java:14)
at jsp_servlet.__memoryleak$1.run(__memoryleak.java:86)
at java.lang.Thread.run(Thread.java:619)

.

If the leak is happening due to a Weblogic Class, it can be a known issue or an undiscovered BUG. You need to get in touch with Oracle Support. If it’s an Application Class, you need to contact the developers. Out of Memory can also happen dude to third party codes such as database drivers.

Latest Comments

  1. pavanwla July 19, 2010
    • admin July 20, 2010
  2. Ramesh January 11, 2011
    • Administrator January 11, 2011
  3. srinivas January 18, 2011
    • Administrator January 21, 2011
  4. smitha April 24, 2011
    • Administrator April 25, 2011
  5. Yatan June 14, 2011
    • Administrator June 30, 2011
  6. fabian dsouza September 20, 2011
    • Administrator September 27, 2011
  7. Afzal November 9, 2011
    • Administrator November 29, 2011
  8. brahmaiah December 2, 2011
    • anandraj December 6, 2011
  9. rajesh March 22, 2012
    • Administrator March 23, 2012
  10. hari babu April 17, 2012
    • Administrator May 9, 2012
  11. Lokesh April 24, 2012
    • Administrator May 9, 2012
  12. krishna November 11, 2013
    • krishna November 12, 2013
  13. krishna November 13, 2013
    • Administrator January 16, 2014
  14. Antonio Melo October 1, 2015
    • Administrator October 13, 2015

Leave a Reply