Thanks for the information!

"Shapira, Yoav" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

Hi,
Now you're starting to ask the right questions.

>If System.runFinalization() and System.gc() are misleading... what
should I
>use instead, to force to garbage collection?

You can't force garbage collection, and it is terrible design to rely on
particular garbage collection timing.  Instead, know that the JVM is
pretty damn good at doing GC, and take throughout your code to not keep
any unneeded references and limit the scope of references as much as
possible.

>So, the amount of memory the JVM uses, will always increase?  How do I
get
>it to decrease?

The amount of memory the JVM uses will monotonically increase up to the
heap limit you set for it via -Xmx plus overhead space e.g. the stack
and symbol tables.  You can't get it to decrease.  You will find this
page helpful, I believe:
http://jakarta.apache.org/tomcat/faq/memory.html

>256 was an arbitrary choice.  Is there some formula I should be using
>(based
>on projected traffic)?

There's no formula in mathematical terms, but there IS a standard
procedure to follow:

1. Establish the maximum expected number of concurrent users your system
should handle, and the average page response time when handling this
number of users.
2. Write a stress test plan using your favorite tool, e.g. JMeter, to
simulate the load determined in #1.
3. Run the tool against your system without any tuning options.  If you
run out of memory, increase available memory (-Xmx) and repeat.  If you
run out of memory but you're fairly sure your system has enough,
consider running with a profiler to see if there are leaks or other
unnecessary memory usage patterns.

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]

Reply via email to