Rich Dougherty wrote:
Hi Daniel
Although MINA probably *uses* buffers for short periods of time, wouldn't it
be possible to make the underlying buffers "long-lived" by pooling them
between usages? Of course, if we pooled buffers then we'd need to support
some mechanism of returning the buffers to the pool (probably an explicit *
free* or *dispose* operation).
Pooling objects instead of simple let the GC dispose them is not a good
strategy with modern JVM. With a pool, you introduce a synchronized
structure which will cost more to manage than letting the JVM creating
new objects.
I have played this game years ago, and when switching to Java 5, and
even Java 1.4 to a certain extent, found it a waste of time and energy ...
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org