Object Pool Pattern - Criticism

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:

    ...I wasn’t 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 (1893–1979)

    It is the will of God that we must have critics, and missionaries, and Congressmen, and humorists, and we must bear the burden. Meantime, I seem to have been drifting into criticism myself. But that is nothing. At the worst, criticism is nothing more than a crime, and I am not unused to that.
    Mark Twain [Samuel Langhorne Clemens] (1835–1910)

    In criticism I will be bold, and as sternly, absolutely just with friend and foe. From this purpose nothing shall turn me.
    Edgar Allan Poe (1809–1845)