Alex Rivera | Logout

Garbage collection vs. non garbage collection programming languages

Asked 2009-09-15T01:20:15.380
17

So if I understand well, Garbage collection automatically deallocates objects that are not used by the program anymore. like the garbage collector in java.

I hear in languages like C that don't support garbage collection the programs can have memory leaks and subsequently exhaust the memory.

So what are the errors that programmer make in languages like C that don't support garbage collection? I would guess not deallocating objects after they're not used anymore. But are these the only errors that we can make because of the lack of a garbage collector?

Edit
Report

1 Answer

9

Well, the errors you can make are:

  • Not deallocating things you don't need
  • Deallocating things you do need

There are other errors you can make, but those are the ones that relate specifically to garbage collection.

answered 2009-09-15T01:21:51.757

Your Answer