JSF memory footprint

I was wondering if there is an 'easy' way to see what the memory footprint is, used by the objects created by JSF. For instance, I have some @SessionScoped objects and some @ViewScoped objects when going to a certain page.

I would like to know how much KB (or MB) they are using. This way, we can make an estimated calculation of the memory footprint per user of JSF.

I am using Eclipse and EAP 7 together with JSF 2.3. I tried using jvisualvm but no specific class information and size in memory is available. I do remember long time ago we had some tool to visualize this kind of information.

Any ideas on how to find out? I guess some Eclipse plugins can work, but I am totally new to this area and have no clue about the better ones...


1 Answers JSF memory footprint

I personally use JVisualVM which is found in every JDK /bin folder installation. You can attach to your running process and watch the memory and objects and their size.

There is no magic bullet to profiling. If you have a SessionSxoped bean named FooBean I open up VisualVm and I go to the Classes tab and filter by FooBean. I then use my load testing tool to simulate real world use and I monitor how many instances of Foo? How much heap are those instances taking? Are they being garbage collected etc.

It takes a little bit of learning but you will get better at it the more you use it.

8 months ago