| Author |
Heap Memory Analysis - Distribution among Session, Stateful EJB and other objects
|
M Kulkarni
Greenhorn
Joined: Jan 18, 2011
Posts: 1
|
|
Hi all,
I am working on heap analysis of a J2EE application running on Websphere. As part of it I captured data like HttpSession size (at different usecases), static data size that gets loaded on startup, stateful EJB size in development environment.
Now I want to come up with percentage distribution of heap memory in production environment. Say approximately I want to come up with statistics like Session memory 20%, static data 40%, stateful EJB 30% and other temp objects taking 10% of the total heap.
So if any one has worked on such analysis of heap, kindly give me some ideas or approach to come up with similar statistics.
Thanks,
MK
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 11862
|
|
Note that there is no way to precisely measure "session size" - a basic session object is just a collection of references to objects which might be unique or might be shared with hundreds of other sessions. Think String pool for example.
You might get at the maximum "size" from the file size of serialized sessions, but that will be deceptive and not represent the additional memory used when one session is created.
Bill
|
Java Resources at www.wbrogden.com
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6371
|
|
|
I think it would make more sense to group memory usage based on Object type or packages ? Most profilers support that
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
Pierre-Hugues Charbonneau
Greenhorn
Joined: Feb 05, 2011
Posts: 9
|
|
Hi M Kulkarni,
What are the specifications of your environment e.g. which version of Java Sun/IBM JDK etc?
Find below one approach we used successfully for many production environments using Sun JDK 1.5, 1.6 and IBM JVM 1.5,1.6:
- Perform a load test with proper load ratio of targeted production load
- Generate a Java Heap Dump (latest JDK versions allow you to generate Java Heap Dump on the fly, extremelly usefull to analyse your application memory footprint)
- Analyse the Heap Dump using Eclipse Memory Analyser
The Heap Dump analysis will provide you a breakdown of your objects and allow you to perform searches in order to come up with a proper Java Heap breakdown and % for each silo that you are interesting in.
|
Regards,
P-H
http://javaeesupportpatterns.blogspot.com/
|
 |
 |
|
|
subject: Heap Memory Analysis - Distribution among Session, Stateful EJB and other objects
|
|
|