A
Anton Spaans
Hello all,
I'd like to run something by you all. It is about tuning the memory settings
for a web-server and app-server. Specifically, it is about the size of the
Survivor Space (SurvivorRatio)
Both our web-server and app-server handle requests which involves the
creation of quite a large number of relatively small objects. Some other
objects that are bigger (more resource-intensive) are cached, mainly during
startup or during run-time using 'lazy loading'.
This means that most of our objects are created in Eden and die there as
well. They'll never tenure to Old Space; e.g. an http-request creates a
number of objects, such as javabeans and strings, for retrieving data and
transforming it into proper html. After this, all these objects outlived
their usefulness and they die.
Most objects that *do* live longer than one generation (survive more than
one scavenge or full GC) will very likely make it into Old Space anyway.
This is because these objects are likely to live the entire lifespan of the
application. Examples of these are objects that are instantiated using 'lazy
loading', such as cached and compiled XSL stylesheets.
Only a few objects will live longer than one generation and die before the
application is shut down. In our code, that would be when a scavenge happens
*while* one or more requests are being handled at the same time.
We run under Sun JDK1.3.1_16, using Tomcat4.1.31 (jsp/servlet container) and
JBoss (app server). We profiled some memory stats using -verbose:gc
and -XX:+PrintTenuringDistribution. After a day-long load test (20
concurrent users continually hitting servers), the tenuring-information
reports a maximum 'Desired survivor size' of 163840bytes. This is half of
the actual Survivor Size, so the maximum size of the Survivor Space (not the
allocated size, but the number of bytes used) is only around 320KBytes...
very small. Also, over 95% of the tenuring-log-entries don't show any
objects older than age 1.
This confirms that most objects never leave Eden: They die there or they
will move to Old Space and live as long as the application itself.
Finally, this is my question:
Since we don't know the exact behavior of the internals of Tomcat, would it
be wise to make set Survivor Space to 0 bytes (i.e. set the SurvivorRatio to
a really high number)? Our objects die in Eden anyway or *will* promote to
Old Space --> SurvivorSpace size can be 0. But what about objects created by
Tomcat or JBoss...? Maybe they 'need' a Survivor Space..?
Thank you very much.
-- Anton Spaans
I'd like to run something by you all. It is about tuning the memory settings
for a web-server and app-server. Specifically, it is about the size of the
Survivor Space (SurvivorRatio)
Both our web-server and app-server handle requests which involves the
creation of quite a large number of relatively small objects. Some other
objects that are bigger (more resource-intensive) are cached, mainly during
startup or during run-time using 'lazy loading'.
This means that most of our objects are created in Eden and die there as
well. They'll never tenure to Old Space; e.g. an http-request creates a
number of objects, such as javabeans and strings, for retrieving data and
transforming it into proper html. After this, all these objects outlived
their usefulness and they die.
Most objects that *do* live longer than one generation (survive more than
one scavenge or full GC) will very likely make it into Old Space anyway.
This is because these objects are likely to live the entire lifespan of the
application. Examples of these are objects that are instantiated using 'lazy
loading', such as cached and compiled XSL stylesheets.
Only a few objects will live longer than one generation and die before the
application is shut down. In our code, that would be when a scavenge happens
*while* one or more requests are being handled at the same time.
We run under Sun JDK1.3.1_16, using Tomcat4.1.31 (jsp/servlet container) and
JBoss (app server). We profiled some memory stats using -verbose:gc
and -XX:+PrintTenuringDistribution. After a day-long load test (20
concurrent users continually hitting servers), the tenuring-information
reports a maximum 'Desired survivor size' of 163840bytes. This is half of
the actual Survivor Size, so the maximum size of the Survivor Space (not the
allocated size, but the number of bytes used) is only around 320KBytes...
very small. Also, over 95% of the tenuring-log-entries don't show any
objects older than age 1.
This confirms that most objects never leave Eden: They die there or they
will move to Old Space and live as long as the application itself.
Finally, this is my question:
Since we don't know the exact behavior of the internals of Tomcat, would it
be wise to make set Survivor Space to 0 bytes (i.e. set the SurvivorRatio to
a really high number)? Our objects die in Eden anyway or *will* promote to
Old Space --> SurvivorSpace size can be 0. But what about objects created by
Tomcat or JBoss...? Maybe they 'need' a Survivor Space..?
Thank you very much.
-- Anton Spaans