Memory footprints on application

Posted on 2008-10-21
Last Modified: 2012-05-05
I have to enterprise applications sharing the same JVM's. We are experiencing performance issues on one of the environment. Is there any way we can figure out how heap usage by one particular application since both the applications are running on same appservers.

WebSphere Version - WAS 6.1
OS - Solaris 9
Question by:Gurinders
  • 4
  • 4
LVL 10

Expert Comment

ID: 22776766
It's understandable if you have memory heap problem in this case.

You can use
 Tivoli® Performance Viewer helps to find memory leaks. For best results, repeat experiments with increasing duration, such as 1000, 2000, and 4000-page requests.

 Also, look at the difference between the number of objects allocated and the number of objects freed. If the gap between the two increases over time, there is a memory leak.
 If heap consumption indicates a possible leak during a heavy workload (the appserver is consistently near 100% CPU utilization), yet the heap appears to recover during a subsequent lighter or near-idle workload, this is an indication of heap fragmentation. Heap fragmentation can occur when the JVM is able to free sufficient objects to satisfy memory allocation requests during garbage collection cycles, but the JVM does not have the time to compact small free memory areas in the heap into larger contiguous spaces.  

For more information


Author Comment

ID: 22777836
Thanks for replying.
This is a production environment and I won't be able to use TPV on it.

"Also, look at the difference between the number of objects allocated and the number of objects freed. If the gap between the two increases over time, there is a memory leak. "

Since my two enterprise applications are sharing the same JVM's, how can I find that from which application the objects are allocated and freed up..

Can you please throw some more light on it.

LVL 10

Accepted Solution

jinn_hnnl earned 500 total points
ID: 22783981
My apology for late response, I was out of office.

Back to your problem, first of all, I would recommend you to experiment the performance test on a development server (I bet you do have), may be you dont have the speed problem on development server due to the less amount of request. But you can increase them up to and amount of 4000, this should be enough to simulate like the production server.

Is that your case: when 2 applications run simultaneously, one of them gets slow down, is that always one specific application or is that sometimes application A, sometimes application B.

These issues below are kind of easiest steps you can perform, with 2 applications, I suggest you run each of them individually (after perform enough requests for both that can leads to memory leak).
 At a certain point, when everything slow down, stop one and check another, check the presummably large object and memory problem, then DO the same for another, one at a time, keep the report and compare. You will surely find the difference.

To detect large object you can use several method, one of them is Analyzing fragmentation:
- Tuning the max heap size
- Tuning Xk/Xp
- Identifying by swprofiler: To identify the large object problem, This tool helps you print the stack information of an object by setting the allocation limit and depth

Performing the heap dump:
This let you to resolve when  memory leak after GC declined, you can use IBM® HeapDump, a utility shipped with the IBM JDK. It lets you dump all the living objects in the Java heap into a text file called heapdump. This tool analyzes the memory usage of every Java object. This is a step to find which of them are consuming JVM space. One thing is for different OS they have different command to dump.

I dont know if you have tried any another solutions, but here what you can find each steps I mention, purposes and solutions. This link provide more information and in another area too.

Hope this helps


Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 10

Expert Comment

ID: 22784014
Some pic to give you an idea what could happen. Even you run individually 2 applications, you will find each of them what kind of problem you faced. Each can create large object or have inappropriate cache sizes (for example). Doesn't matter which, but you gotta solve it individually to eliminate the problem



Author Comment

ID: 22786523
Thanks for valuable solutions.

Well l want to tell you some more information. My apologies, I think my question was not complete.
As I mentioned earlier, there are two applications running, like A and B.
Application A is running successfully for more than 2 years without any troubles. A month before we deployed an other application, here it is "B"  and only B application have performance issues.
As suggested ahead I can take heap dumps on Test environment can figure out the heap usage.
In the mean time if you have anything else in your mind, please update me with that.

Thanks and I appreciate your replies.
LVL 10

Expert Comment

ID: 22794243

I think you will find at which request and what type of objects causes the memory leak, there are solutions in the article I gave, it will do.

Another suggestion I would like to mention is, the problem might even came from your first application which was fine before. This application might generated unnecessary large objects and causes the problem, or doesn't have sufficient cache settings. It was fine due to server availabilities back then, but as soon as the JVM is shared with another, these critical part appears to be the problem.

For timing issues, you can focus on analyzing the 2nd application, after you done, I recommend to do the same test for the 1st to have even better view for refactoring and clean up your source code.


Author Comment

ID: 22854135
I apologies for this late reply.
I resolved the issue by separating the JVM's.

Thanks for your help and sollutions.

Author Closing Comment

ID: 31508580

Featured Post

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Building iPhone Apps 6 60
IIS: Multiple user recognition behid one IP 2 77
Live mode in DW, need to creae Session 4 107
cookies analysis tools 2 100
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question