Criticism
Some publications do not recommend using object pooling with certain languages, such as Java, especially for objects that only use memory and hold no external resources. Opponents usually say that object allocation is relatively fast in modern languages with garbage collectors; while the operator new
needs only ten instructions, the classic new
- delete
pair found in pooling designs requires hundreds of them as it does more complex work. Also, most garbage collectors scan "live" object references, and not the memory that these objects use for their content. This means that any number of "dead" objects without references can be discarded with little cost. In contrast, keeping a large number of "live" but unused objects increases the duration of garbage collection. In some cases, programs that use garbage collection instead of directly managing memory may run faster.
Read more about this topic: Object Pool Pattern
Famous quotes containing the word criticism:
“Nothing would improve newspaper criticism so much as the knowledge that it was to be read by men too hardy to acquiesce in the authoritative statement of the reviewer.”
—Richard Holt Hutton (18261897)
“It is ... pathetic to observe the complete lack of imagination on the part of certain employers and men and women of the upper-income levels, equally devoid of experience, equally glib with their criticism ... directed against workers, labor leaders, and other villains and personal devils who are the objects of their dart-throwing. Who doesnt know the wealthy woman who fulminates against the idle workers who just wont get out and hunt jobs?”
—Mary Barnett Gilson (1877?)
“...I wasnt at all prepared for the avalanche of criticism that overwhelmed me. You would have thought I had murdered someone, and perhaps I had, but only to give her successor a chance to live. It was a very sad business indeed to be made to feel that my success depended solely, or at least in large part, on a head of hair.”
—Mary Pickford (18931979)