-4

Possible Duplicate:
What is the difference between Objective-C automatic reference counting and garbage collection?

Can someone please tell me that, what is the basic difference between Garbage collector in JAVA and ARC?

Community
  • 1
  • 1
Apurv
  • 17,116
  • 8
  • 51
  • 67
  • Did you look here: http://stackoverflow.com/questions/6385212/how-does-the-new-automatic-reference-counting-mechanism-work – Azodious Jan 09 '13 at 07:51
  • and here: http://stackoverflow.com/questions/7756006/does-automatic-reference-counting-work-as-garbage-collector – Azodious Jan 09 '13 at 07:54

1 Answers1

2

In one sentence: The garbage collector finds and collects retain cycles, ARC does not.

Nikolai Ruhe
  • 81,520
  • 17
  • 180
  • 200
  • 3
    There are so many other differences. GC happens in the background while ARC is just manual memory management that is done by the compiler. iOS doesn't support GC. It's deprecated in OS X. – rmaddy Jan 09 '13 at 07:55
  • @rmaddy True. I would add that ARC is deterministic, in my opinion the crucial advantage over GC. But in my answer I wanted to emphasize the main difference of how ARC and GC manage memory since this affects the way we design our code the most. – Nikolai Ruhe Jan 09 '13 at 08:16
  • Yes, I meant to mention the deterministic quality. Plus, GC has a lot more runtime overhead as it finds memory that is safe to clean up. – rmaddy Jan 09 '13 at 08:20