Skip to main content

A Dip in the Autopool

Posted by mason on October 3, 2004 at 12:05 AM PDT

Object pooling in Java is generally a bad idea for many reasons, not the least of which it has the nasty ability to actually cause the very performance problems you are trying to solve on modern JVMs, but there are always cases where the resources available to your application are in such limited supply that you really don't have a choice in the matter. Instances are rare, but in some cases you just pay too great a resource cost for each object and a pool is required.

I ran across just such a situation while redesigning my personal website, and seeing how it was personal, I had a lot of leeway to experiment. One small annoyance kept popping up time and time again. If you ever forgot to return the object to the pool, you

Related Topics >>