Boehm Garbage Collector - Design

Design

The developer describes the operation of the collector as follows:

The collector uses a mark-sweep algorithm. It provides incremental and generational collection under operating systems which provide the right kind of virtual memory support. (Currently this includes SunOS, IRIX, OSF/1, Linux, and Windows, with varying restrictions.) It allows finalization code to be invoked when an object is collected. It can take advantage of type information to locate pointers if such information is provided, but it is usually used without such information.

— http://www.hpl.hp.com/personal/Hans_Boehm/gc/#details

Boehm GC can also run in test mode in which memory management is still done manually, but the Boehm GC can check if it is done properly. In this way a programmer can find memory leaks and double deallocations.

Boehm GC is also distributed with a C string handling library called cords. This is similar to ropes in C++ (strings are trees of small arrays, and they never change), but instead of using reference counting for proper deallocation, it relies on garbage collection to free objects. Cords are good at handling very large texts, modifications to them in the middle, slicing, concatenating, and keeping history of changes (undo/redo functionality).

Read more about this topic:  Boehm Garbage Collector

Famous quotes containing the word design:

    “Westerners inherit
    A design for living
    Deeper into matter—
    Not without due patter
    Of a great misgiving.”
    —Robert Frost (1874–1963)

    “The reason American cars don’t sell anymore is that they have forgotten how to design the American Dream. What does it matter if you buy a car today or six months from now, because cars are not beautiful. That’s why the American auto industry is in trouble: no design, no desire.”
    —Karl Lagerfeld (b. 1938)

    “We find that Good and Evil happen alike to all Men on this Side of the Grave; and as the principle Design of Tragedy is to raise Commiseration and Terror in the Minds of the Audience, we shall defeat this great End, if we always make Virtue and Innocence happy and successful.”
    —Joseph Addison (1672–1719)