I am very familiar with the concept of object pooling and I always try to use it as much as possible.
Additionally I always thought that object pooling is the standard norm as I have observed that Java itself as well as the other frameworks use pooling as much as possible.
Recently though I read something that was completely new (and counter-intuitive?) to me.
That pooling actually makes program performance worse especially in concurrent applications, and it is advisable to instantiate new
objects instead, since in newer JVMs, instantiation of an object is really fast.
I read this in the book: Java Concurrency in Practice
Now I am starting to think if I am missunderstanding something here since the first part of the book adviced to use Executors
that reuse Thread
s instead of creating new instances.
So has object pooling become deprecated nowadays?