File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes To find out memory leaks in struts application  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "To find out memory leaks in struts application  " Watch "To find out memory leaks in struts application  " New topic
Author

To find out memory leaks in struts application

Abhi Singh
Greenhorn

Joined: Feb 02, 2010
Posts: 13
Sometimes I am getting OutOfMemory error when running my projects for multiple users.I am using jdk 1.6,netbeans 6.0. Can anyone suggest how to find out the memory leaks or to overcome this error. As I am using jdk 1.6, it takes the size of the heap automatically according to the operating System.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You could use a code profiler, but so far it sounds like it'd be easier to just look at the stack trace to see when the OOM occurs--without any further information it sounds like you're just doing something that's eating all the memory.
Abhi Singh
Greenhorn

Joined: Feb 02, 2010
Posts: 13
Thank you David for your suggestion. I have used profiler to get those results but I am not getting the actual point where the leakage occurs. Still i will try. Anyways thanks for your suggestion
walter wang
Ranch Hand

Joined: Jun 02, 2001
Posts: 154
using PrintClassHistogram as VM parameter, and dumping several memory snapshots at different time to GC.log file,

By analyzing incensement of number and size of objects, you could find the root cause.


public class Walter { public boolean is_Working_Now (boolean is_boss_Coming) { return is_boss_Coming; }
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

JavaRanch FAQ: InvestigateOutOfMemoryError


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To find out memory leaks in struts application