Choosing the right heap size

Hi,

I think it is fair to say that in order to tune an application, you need determine

1. the right heap size

2. the right garbage collection scheme

I think I can answer the item 1. You can run your application for period of time say couple of days without any interruption, i.e. shutting down the application server etc. and observer the heap usage. This should give you pretty good idea as to how the heap value should be size. Please correct me.

I don't know how to go about determining the item 2.I would appreciate if you help here.

Thanks in advance.

Mustafa

[615 byte] By [ACaycia] at [2007-11-27 4:20:30]
# 1
How does one observe the heap usage?
hillmia at 2007-7-12 9:27:34 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

For garbage collection issues, see: http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html

Section 5.1 explains which collector to select for which type of application.

The current heap usage can be easily monitored by "jstat -gc <pid> <interval".

Nick.>

nicolasmichaela at 2007-7-12 9:27:34 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
Hi Nick,So the heap usage according to jstat is:EU + S0U + S1U + OU.If I am not mistaken PU does not play into heap usage.Thanks,Mustafa
ACaycia at 2007-7-12 9:27:34 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4
Correct.Nick.
nicolasmichaela at 2007-7-12 9:27:34 > top of Java-index,Java HotSpot Virtual Machine,Specifications...