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:

    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)

    Homoeopathy is insignificant as an art of healing, but of great value as criticism on the hygeia or medical practice of the time.
    Ralph Waldo Emerson (1803–1882)

    Unless criticism refuses to take itself quite so seriously or at least to permit its readers not to, it will inevitably continue to reflect the finicky canons of the genteel tradition and the depressing pieties of the Culture Religion of Modernism.
    Leslie Fiedler (b. 1917)