Hi, I read an onjava.com article regarding new features in Tomcat 5. In that article, it said "a whole new mapper was implemented that generates little or no garbage (lots of object recycling is going on in there)." And that improves performance.
But from Sun's web page, it said do not pool objects. So my question is "Is it a good idea to do object pooling" for the sake of performance improvement? Thank you. >From onjava.com article, http://www.onjava.com/pub/a/onjava/2004/01/28/tomcat5.html?page=1 Tomcat 5.0 has had many garbage creation (read performance enhancement) changes since Tomcat 4.1. Tomcat 5.0's single most important garbage-creation refactoring was the new request URI mapper. After some optimization profiling, Tomcat 4.1's request pipeline was found to create excess garbage while mapping a Connector's requests to the proper Container. For Tomcat 5, a whole new mapper was implemented that generates little or no garbage (lots of object recycling is going on in there), and thus Tomcat 5.0's request pipeline performs noticeably better than that of Tomcat 4.1. This also lowers the overall memory usage compared to Tomcat 4.1, which helps to prevent OutOfMemoryExceptions in the web apps it runs, and helps Tomcat 5 to scale higher vertically (i.e. higher scalability on a single machine). >From http://java.sun.com/docs/hotspot/gc1.4.2/faq.html 31. Should I pool objects to help GC? Should I call System.gc() periodically? The answer to these is No! Pooling objects will cause them to live longer than necessary. We strongly advise against object pools.