• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.



 
reply
    Bookmark Topic Watch Topic
  • New Topic