• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

Slow Memory Leaks - Plz help Objects and HeyHey

Hi Experts,

I have a huge webapplication which sits on WLS. It relies on xml objects, webservices, ejbs etc (core J2EE). Now, when I run the application for few days, the heap slowly grows and throws OutOfMemory exception.

I tried using OptimizeIt 6.0 and figured out a couple of memory leaks. They are fixed. But still I find some growth in the heap. Is there any better tool used by you guyz for figuring out such problems?...I tried JProbe and YourKit as well. They don't seem to detect slow memory leaks.

I understand the pain in detecting slow memory leaks. Because one has to wait all the time to just reproduce it. Are there any suggestions from you folks?..Any pointers would be of great help.

-Rajesh
0
rajesh_bala
Asked:
rajesh_bala
  • 7
  • 4
  • 3
  • +2
3 Solutions
 
suprapto45Commented:
Hi Rajesh,

If I were you, I will not use any tools but I will try to look over at the codes and try to check where the heaps are growing. It may be that you forget to close your connection to DB, or you have some Collections that are containing large data but you have not set them into null.

Maybe, you try to look in which module the heap is growing extensively. Then, you need to do something on that modules. I know that it is very painful to do so but I just have no other solution. I do not know any tools that can help you but I think that to solve it, you need to fix the Java codes itself.

Regards
Dave
0
 
suprapto45Commented:
Hi aozarov,

Nice meeting you. It seems that I am just a small Java programmer to you :). How many years have you been involved in Java? Haha just curios :).

Regards
Dave
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
rajesh_balaAuthor Commented:
Hi Dave,
I have been programming for the past 5-7 years...:)..yeah..To fix the earlier memory leaks, I had to look at the code..:)..But if there are 2000-5000 classes along with some other classes like xml parsers etc, you really can't rely on code reading. Thatz why I rely on tools to nail down to the methods and classes and then start looking at those specific classes.

I have quite a bit of experience in finding memory leaks in my earlier projects. But since this is a very slow memory leak, it becomes difficult. So just wanted to know if the experts here have encountered similar problems or not.

-Rajesh
0
 
rajesh_balaAuthor Commented:
Hi aozarov,

Thankx for the links. I have already tried the first link. Let me check on the second link. thankx for your links once again.

-Rajesh
0
 
rajesh_balaAuthor Commented:
Unfortunately the first link is not meant for Java.

-Rajesh.B
0
 
aozarovCommented:
>> Unfortunately the first link is not meant for Java.
" trace to resolve memory problems in C/C++ applications and object growth in Java."
Did you read their fact sheets? http://www.ocsystems.com/pdf/RootCause_factsheet.pdf
0
 
suprapto45Commented:
Hi Rajesh,

Yes, if there 2000-5000 classes, it is killing to search it one by one. Okay, I am listening to thread then :).

Regards
Dave
0
 
aozarovCommented:
>> It may be that you forget to close your connection to DB,
Though programatically it is very important to close any resources in a finally block in that case
most application server will detect when a connection is not returned to the pool at the end of the transaction and will give some warning.

In order to expedite the debugging process you can try to decrease the memory size and increase the load.
0
 
rajesh_balaAuthor Commented:
http://www.codeproject.com/debug/Memory_leak_finder.asp

Sorry about that..I meant this..First one, I have already tried.

-Rajesh.B
0
 
rajesh_balaAuthor Commented:
Thanks for the comment aozarov. I am doing that ..I have reduced my heap from 1024Mb to -Xms256m -Xmx256m.

Also, there is no leak in database connections. I have verified that. Its mainly to do with the java code other than JDBC.

-Rajesh.B
0
 
cmalakarCommented:
Hi Rajesh,

        Have u used JRockit Memory Leak Detector provided in WLS. Have a look at the following link:

http://e-docs.bea.com/wljrockit/docs142/userguide/memleak.html

Also note that if the deployed beans idle time out descriptor has been specified or not in the deployement descriptor.

-cmalakar
0
 
CEHJCommented:
>>Objects and HeyHey

The latter hasn't been around for a long time ;-)
0
 
cmalakarCommented:
You can also have a look at the cache descriptors given in deployment descriptors
0
 
rajesh_balaAuthor Commented:
Hi cmalakar,
That was a good thought. I had used JRA also. In JDK 1.4.2 version of it, it had "MemoryLeak Detector" which you can view using Management console. In JDK 1.5, they expose those using MBeans and the management console is different. You would be able to view the obejcts etc, but not the memoryleak detector kinda thing.

To add to the complexity of the problem, I am using JDK 1.5 classes..:(..But  tried doing JRA as well.

- Rajesh.B


Hi CEHJ,

I didn't mean anything wrong..I joinned this group on 2000 and at that time, HeyHey was of great help. Not sure whether he is busy these days or not..:)..Your posts are very interesting too..Its been a while since I entered this great forum now. Can you please give your thoughts on this problem also?..It would be of great help.

-Rajesh.B
0
 
CEHJCommented:
Not much i can add of use unfortunately as i haven't any experience of using any profiler ;-)
0
 
rajesh_balaAuthor Commented:
Sorry for the delay in posting the update. Atlast I managed to figure out the leaks using OptimizeIt 6. And things are moving fine now. I am not sure how to split the points and give it. Any suggestions would be appreciated.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 7
  • 4
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now