tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Tomcat <>
Subject RE: Object pooling (was: more about custam tag life cycle)
Date Sun, 02 Feb 2003 14:13:24 GMT
On Tue, 2003-02-04 at 00:34, Ralph Einfeldt wrote:
> I prefer to use pooled objects either for relative small number of
> long lived objects or for objects that are expensive to create, or 
> immutable objects that consume some memory and are likely to be in 
> use concurrently.

Pooling is actually a great thing to do with immutable objects.  The
object is immutable, so it is in a correct state from construction to
garbage collection.  Also, because it is immutable, it can be shared by
multiple threads and other objects.  That's great.  If tags were
immutable, then pooling might be a very cool feature.  Unfortunately,
tags have the worst of both worlds: they are mutable, and they are
pooled.  This means they are difficult to use correctly because they are
trying to work like C++ things instead of like Java things.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message