This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Heap Memory Analysis - Distribution among Session, Stateful EJB and other objects  RSS feed

 
M Kulkarni
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it would make more sense to group memory usage based on Object type or packages ? Most profilers support that
 
Pierre-Hugues Charbonneau
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!