File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes Memory leak in j2ee application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Memory leak in j2ee application" Watch "Memory leak in j2ee application" New topic

Memory leak in j2ee application

shweta misra

Joined: Jun 06, 2012
Posts: 10
I have to resolve a memory leak issue in a j2ee application running on weblogic application server.
Wanted some pointers on how to start working on this. what important aspects should i review.

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Maybe start by looking at heap dumps (and maybe thread dumps), possibly using a tool like VisualVM.
Chris Hurst
Ranch Hand

Joined: Oct 26, 2003
Posts: 443

Google getting a hprof.

Download Eclipse MAT and run its memory leak suspects report.

"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
chandan Khatri

Joined: Aug 17, 2011
Posts: 10
Hi Shweta,

As mentioned above you should start looking in to heap dumps. You can use JMeter to run scripts and get heap dumps at different intervals. This will help you analyse application memory consumption at different times.
Jprofile is also a great tool that can give you snapshots of memory upto the method level. Also run your weblogic with verbose option which provide memory statistics and you will be able to see the consumption of memory changing in logs as well.

Hope this helps you in some way .

Krishna Kanth
Ranch Hand

Joined: Oct 23, 2006
Posts: 49

How do you know there is a memory leak? may be your application is not provided enough space to process all the requests it is accepting.
I would confirm there is indeed a memory leak by connecting to applicaiton from jconsole and generating average and steady traffic for 6 hours.

Or you can skip this step and go to JProfiler / HeapDump analysis straight away, but would not help unless you already know what kind of request to your app is causing memory leak.
soundar rajan

Joined: May 08, 2013
Posts: 16
Another way of finding memory leaks is to enable the GC logs and analyze the same. Please find the reference for enabling and analyzing the same:
Luan Cestari
Ranch Hand

Joined: Feb 07, 2010
Posts: 163

Use 'jmap' to get the heap dump and Eclipse Memory Analyzer (Eclipse MAT) to analyze the file generated (hprof). The Eclipse have some default reports, one for this case is called "Leak Report".


Please, visit me for some cool tech post at
I agree. Here's the link:
subject: Memory leak in j2ee application
It's not a secret anymore!