Principles
The basic principles of garbage collection are:
- Find data objects in a program that cannot be accessed in the future
- 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:
“Government ... thought [it] could transform the country through massive national programs, but often the programs did not work. Too often they only made things worse. In our rush to accomplish great deeds quickly, we trampled on sound principles of restraint and endangered the rights of individuals.”
—Gerald R. Ford (b. 1913)
“It must appear impossible, that theism could, from reasoning, have been the primary religion of human race, and have afterwards, by its corruption, given birth to polytheism and to all the various superstitions of the heathen world. Reason, when obvious, prevents these corruptions: When abstruse, it keeps the principles entirely from the knowledge of the vulgar, who are alone liable to corrupt any principle or opinion.
”
—David Hume (17111776)
“My country is bleeding, my people are perishing around me. But I feel as a South Carolinian, I am bound to tell the North, go on! go on! Never falter, never abandon the principles which you have adopted.”
—Angelina Grimké (18051879)