Garbage Collection (computer Science) - Principles

Principles

The basic principles of garbage collection are:

  1. Find data objects in a program that cannot be accessed in the future
  2. Reclaim the resources used by those objects

Many computer languages require garbage collection, either as part of the language specification (e.g., Java, C#, and most scripting languages) or effectively for practical implementation (e.g., formal languages like lambda calculus); these are said to be garbage collected languages. Other languages were designed for use with manual memory management, but have garbage collected implementations available (e.g., C, C++). Some languages, like Ada, Modula-3, and C++/CLI allow both garbage collection and manual memory management to co-exist in the same application by using separate heaps for collected and manually managed objects; others, like D, are garbage collected but allow the user to manually delete objects and also entirely disable garbage collection when speed is required. While integrating garbage collection into the language's compiler and runtime system enables a much wider choice of methods, post hoc GC systems exist, including some that do not require recompilation. (Post-hoc GC is sometimes distinguished as litter collection.) The garbage collector will almost always be closely integrated with the memory allocator.

Read more about this topic:  Garbage Collection (computer Science)

Famous quotes containing the word principles:

    In child rearing it would unquestionably be easier if a child were to do something because we say so. The authoritarian method does expedite things, but it does not produce independent functioning. If a child has not mastered the underlying principles of human interactions and merely conforms out of coercion or conditioning, he has no tools to use, no resources to apply in the next situation that confronts him.
    Elaine Heffner (20th century)

    The principles of the good society call for a concern with an order of being—which cannot be proved existentially to the sense organs—where it matters supremely that the human person is inviolable, that reason shall regulate the will, that truth shall prevail over error.
    Walter Lippmann (1889–1974)

    I am not one of those who have the least anxiety about the triumph of the principles I have stood for. I have seen fools resist Providence before, and I have seen their destruction, as will come upon these again, utter destruction and contempt. That we shall prevail is as sure as that God reigns.
    Woodrow Wilson (1856–1924)