When an object is requested, it is served from the pool.
When the object is disposed, it is placed back into the pool to await the next
request that might come in at a later point in time. The pool initially
consists of a number of objects. When a request for creation of an object comes
in, the request is server from the pool of objects and the number of the
available objects in the pool decreases by one. This process continues until
the pool runs out of objects. The pool remains in memory as long as there is at
least one object in the pool. The pool facilitates reusability and eliminates
the overhead involved in creation of objects whenever they are requested. The
following section discusses how an Object Pool (though somewhat similar to a
Connection Pool) differs from a Connection Pool. You can find my article on
Connection Pooling here.