• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Memory leak in j2ee application

 
shweta misra
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe start by looking at heap dumps (and maybe thread dumps), possibly using a tool like VisualVM.
 
Chris Hurst
Ranch Hand
Posts: 443
3
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google getting a hprof.

Download Eclipse MAT and run its memory leak suspects report.
 
chandan Khatri
Greenhorn
Posts: 10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .

Regards,
Chandan
 
Krishna Kanth
Ranch Hand
Posts: 49
1
Chrome Java Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://www.tagtraum.com/gcviewer.html
 
Luan Cestari
Ranch Hand
Posts: 163
C++ Redhat Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".

Regards!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic