Link to home
Start Free TrialLog in
Avatar of rajesh_bala
rajesh_balaFlag for India

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of suprapto45
suprapto45
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of rajesh_bala

ASKER

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
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
Unfortunately the first link is not meant for Java.

-Rajesh.B
Avatar of aozarov
aozarov

>> 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
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
>> 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.
http://www.codeproject.com/debug/Memory_leak_finder.asp

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

-Rajesh.B
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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CEHJ
>>Objects and HeyHey

The latter hasn't been around for a long time ;-)
You can also have a look at the cache descriptors given in deployment descriptors
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
Not much i can add of use unfortunately as i haven't any experience of using any profiler ;-)
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.