On Wed, Mar 11, 2009 at 1:56 AM, Caldarale, Charles R
<chuck.caldar...@unisys.com> wrote:
>
> It's impossible to prevent at least some objects from eventually migrating to 
> the OldGen, since anything that persists long enough will end up there after 
> some number of minor GCs.

But by choosing a large enough heap size (and evtl. according
strategy) it is possible to optimize the usage of the eden aka young
space and to reduce the amount of minor collections, hence reducing
the chances for unnecessary migration into old space. However, in a
webapp, anything you create during the processing of a request should
remain in the eden and 'die young' (unless you put it in a session or
a cache explicitely).

JMX gives you the access to MemoryPool usage statistics and you can
actually monitor all of heap-spaces separately. Moskito btw, gathers
this info and presents it via its web ui:
http://moskito.anotheria.net/moskitodemo/mui/mskShowProducersByCategory?pCategory=memory

We use this info to create graphs of free memory in relevant spaces
(the tenured/old space, depending on the collector is the most easiest
to monitor, and most relevant to performance) and optimize the
settings unless the memory usage graphs are looking well (not hectic,
well formed sawtooth). With the graph you would also detect a memory
leak much faster, even if the heap size would be too large.

regards
Leon

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to