0

The documentation for commons-pooling-1.6 defines GenericObjectPool as:

GenericObjectPool provides robust pooling functionality for arbitrary objects.

Furthermore, the Javadocs show a large number of fields that can be used to configure this pool.

The Javadocs also define StackObjectPool as:

A simple, Stack-based ObjectPool implementation [that] places no limit on the number of "active" instances created by the pool, but is quite useful for re-using Objects without introducing artificial limits.

But I can't find any literature comparing these two pools against one another:

  • What are the pros/cons for them both?
  • When should one use GenericObjectPool over StackObjectPool, and vice-versa?
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756

1 Answers1

0

I think the GenericObjectPool is just more configurable. But at four times the length, it's more likely to have bugs. As long as you code against the interface, you can switch between them if you have problems with one.

There is a comparison here http://commons.apache.org/pool/guide/index.html.

artbristol
  • 32,010
  • 5
  • 70
  • 103