Stefano Mazzocchi wrote:


On Thursday, Jul 24, 2003, at 06:40 America/Guayaquil, Christoph Gaffga wrote:


Hi,
we are running Cocoon 2.1m3 on JDK 1.2
with -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Xmx120
0m -Xms1200m and we see only little perfomance increase. But there is
something I read in the java perfomance docs, they say: Don't use object
pools, because the internal garbagge collection ist better and does it
faster, also with overhead of creating an new instance. Is this true for
cocoon?



find it out yourself by turning the max-pool values to 0 in the sitemap. i would very happy to know if the above is true myself.


I large part of that has to do with a very basic assumption:  the cost
to create a new instance is lower than the cost to collect it.  For things
like Strings, Integers, Lists, etc. the cost to create is very small.  For
other things where a heavier resource is attached like network connections,
any kind of I/O, and complex components (ones that take a fair amount of
time to configure and get up and running), then you will find a threshold
where pooling is more effective than just letting the garbage collector
do its thing.

Ideally, your pool would use weak references so that the garbage collector
can still do its thing.


--


"They that give up essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety."
                - Benjamin Franklin



Reply via email to