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


Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Using Quotation Marks in PHP This question ( seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

777 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