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:

    Magic is akin to science in that it always has a definite aim intimately associated with human instincts, needs, and pursuits. The magic art is directed towards the attainment of practical aims. Like other arts and crafts, it is also governed by a theory, by a system of principles which dictate the manner in which the act has to be performed in order to be effective.
    Bronislaw Malinowski (1984–1942)

    Only conservatives believe that subversion is still being carried on in the arts and that society is being shaken by it.... Advanced art today is no longer a cause—it contains no moral imperative. There is no virtue in clinging to principles and standards, no vice in selling or in selling out.
    Harold Rosenberg (1906–1978)

    That, upon the whole, we may conclude that the Christian religion not only was at first attended with miracles, but even at this day cannot be believed by any reasonable person without one. Mere reason is insufficient to convince us of its veracity: And whoever is moved by Faith to assent to it, is conscious of a continued miracle in his own person, which subverts all the principles of his understanding, and gives him a determination to believe what is most contrary to custom and experience.
    David Hume (1711–1776)