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:
“Ah, I fancy it is just the same with most of what you call your emancipation. You have read yourself into a number of new ideas and opinions. You have got a sort of smattering of recent discoveries in various fieldsdiscoveries that seem to overthrow certain principles which have hitherto been held impregnable and unassailable. But all this has only been a matter of intellect, Miss Westsuperficial acquisition. It has not passed into your blood.”
—Henrik Ibsen (18281906)
“It is not impossible, of course, after such an administration as Roosevelts and after the change in method that I could not but adapt in view of my different way of looking at things, that questions should arise as to whether I should go back on the principles of the Roosevelt administration.... I have a government of limited power under a Constitution, and we have got to work out our problems on the basis of law. Now, if that is reactionary, then I am a reactionary.”
—William Howard Taft (18571930)
“...at this stage in the advancement of women the best policy for them is not to talk much about the abstract principles of womens rights but to do good work in any job they get, better work if possible than their male colleagues.”
—Virginia Crocheron Gildersleeve (18771965)