Object pooling is the act of reusing a limited number of objects to serve a much larger number of clients.
For example, a web container might have 100 threads (threads are also objects for a
Java application) at its disposal but it still might have to serve 1000 end-users with their web browsers. The way this is done is that the incoming HTTP requests are put into a queue and they stay there until the container allocates one of the 100 threads for processing that particular HTTP request. Once the
thread is done with the request, it returns back to the pool and the container allocates it to the next waiting HTTP request in the queue.
You could take a look at the
Jakarta Commons Pool project, which provides an API for implementing object pools into your application.