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:

    It is from the womb of art that criticism was born.
    Charles Baudelaire (1821–1867)

    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)

    The greater the decrease in the social significance of an art form, the sharper the distinction between criticism and enjoyment by the public. The conventional is uncritically enjoyed, and the truly new is criticized with aversion.
    Walter Benjamin (1892–1940)