Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 10-11-2009
Member
 
Join Date: Sep 2009
Posts: 177
What are the two kinds of Garbage Collectors for C++?

I am a new learner of C++. I am not that good at programming. I am confused over the Garbage Collectors in C++. I am finding it difficult to understand Garbage Collectors. Also I have read there are two types of Garbage collectors in C++. Can anyone explain to me what are the two kinds of Garbage Collectors.
Reply With Quote
  #2  
Old 10-11-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: What are the two kinds of Garbage Collectors for C++?

There are two types of Garbage Collectors in C++:
> Conservative Garbage Collectors.
> Hybrid Garbage Collectors.

Conservative Garbage Collectors:
They have almost negligible knowledge of the layout of the stack of of C++ objects. They only search for the bit patterns that appear to be pointers.

Hybrid Garbage Collectors:
They require the programmer to provide the layout information for heap objects. But they scan the stack conservatively.
Reply With Quote
  #3  
Old 10-11-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: What are the two kinds of Garbage Collectors for C++?

C++ is really a very logical programming language. You need to be logically thoughtful to successfully learn C++. To put into simpe words, Garbage Collection is a form of automatic memory management. A garbage collector is very helpful, since it eliminates a big source for bugs, memory leaks and runtime crashes. Garbage collection can make programmers more productive by removing some programming load on theseprogrammers in much the same way that high-level languages remove loads that assembly language does not.
Reply With Quote
  #4  
Old 10-11-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: What are the two kinds of Garbage Collectors for C++?

Garbage collection was invented by John McCarthy around 1959. The garbage collector aim at collecting memory occupied by objects that are no longer in use by the program. One very important aspect of Garbage Collection are dangling pointer bugs, which occur when a piece of memory is made free while there are still pointers to it, and one of those pointers is then used. Garbage Collection causes additional overhead for repeated operations like compaction, reference counting, and memory initialization. C++ also supports these Garbage Collectors
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What are the two kinds of Garbage Collectors for C++?"
Thread Thread Starter Forum Replies Last Post
Will there be Game of Throne Collectors Edition ? cech Video Games 2 29-05-2012 07:04 PM
What are the different kinds of computers? Tau-Mai Hardware Peripherals 8 29-12-2011 05:34 AM
Will there be any collectors edition for Stronghold 3 Kumar esan Video Games 8 28-10-2011 05:56 PM
Limited & collectors edition of Dead island akkiiii Video Games 2 06-09-2011 11:45 PM
Dead Space 2 Collectors Edition Unboxing Wyvern Video Games 4 25-01-2011 07:26 PM


All times are GMT +5.5. The time now is 03:39 PM.