[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
GarbageCollection

(Computer science) Gargabe collection

Garbage collection is a term used for memory management. Programming languages provide different mechanisms for allocating memory. In the C programming language the malloc function if responsible for allocating memory while in Java and C++ the new keyword creates memory space for objects. When the program is finished with this memory the allocated space must be freed back to the operating system. If the memory is not returned it leaves the possibility of potential memory leaks, memory that was never freed.

Older programming languages like C and C++ are implemented with manual garbage collection, giving the responsibility of freeing memory to the programmer. Newer languages like Java have their own built in automatic garbage collection.

Automatic Memory management is an alternative to traditional resource management. Some programming language and compilers support it (Java), support it optionally (C# .NET) or do not yet support it (C++). Automating the garbage collection process makes memory leaks impossible, making software development shorter. Object oriented languages, however, supply classes enabling to let the garbage collection be delegated to these classes. This also makes memory leaks virtually impossible.

Here is a partial list of the type of garbage collecting systems out there.

  • Mark and Sweep
  • Incremental garbage collection
  • Compacting garbage collection/Stop and Copy
  • Compacting, Incremental garbage collection
  • Generational garbage collection
  • Big bag of Pages
Note: Some of these techniques can be combined

'Garbage collection' links

  •  ?C++


last edited (November 18, 2006) by bilderbikkel, Number of views: 1036, Current Rev: 1

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.