Howdy,
JProfiler is one option, there are many others. I use OptimizeIt on a
regular basis.
How to profile? Umm, that's a bit of a black art. Basically, start the
profiler following its documentation on how to tie it into your tomcat
process. You will see where CPU time is spent and where memory is
allocated. Look for unnecessary allocations ("why do I still have 20
instance of foo.bar around, they should all be gone by now...") and
overly heavy methods ("how come foo.bar.getX is taking 5 seconds, it's a
simple read operation").
Profiling and memory tuning go hand in hand. You will go through
several iterations of playing with the Java VM Options before you settle
on the optimal one.
Can tomcat handle 300 users? Sure, depending on your hardware and your
webapps. This is why you stress-test your app with a tool like JMeter
that can simulate 300 users hitting your site.
>> > Let me do some divination. You are using a SUN Jvm, with no Xms nor
Xmx
>> > parameter. So, the memory allocated to your applications is 64MB
>> > (default). 158 is a good value reflecting the size of the VM plus
the
>> size
>> > allocated to your applications.
Umm, no. 64MB is the default heap which includes the VM and your
applications. At that size, VM stack/symbol table overhead is far less
than 64MB, and so the total process resident size would not be 158MB
unless other wacky things were going on. But anyways, my point is that
whatever you specify in -Xmx is total for the JVM's heap, which includes
its own objects as well as your applications, not just your
applications.
And another basic note on JVM memory usage: it will never go down
overnight. The JVM allocates memory as needed (by default, this can be
changed using parameters like -Xms), and will not release that memory
back to the operating system, ever. It'll release the memory back into
its own heap, but it will stay tied to the JVM process. JVM process
memory is monotonically increasing in the strict mathematical sense of
the term.
Yoav Shapira
This e-mail, including any attachments, is a confidential business communication, and
may contain information that is confidential, proprietary and/or privileged. This
e-mail is intended only for the individual(s) to whom it is addressed, and may not be
saved, copied, printed, disclosed or used by anyone else. If you are not the(an)
intended recipient, please immediately delete this e-mail from your computer system
and notify the sender. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]