title: Mark-and-Sweep vs. Automatic Reference Counting
body: <p>As we all know, the HotSpot JVM uses a concurrent Mark-and-Sweep <strong>G</strong>arbage <strong>C</strong>ollector to release unused objects on the heap. This is useful in a sense that programmers don't have to take care of memory while making their programs, but comes with an occasional 'GC lag' that releases all unused objects.</p>
  
  <p>Likewise, the new Swift programming language also utilizes an automatic memory management system called ARC, which works with <strong>A</strong>utomatic <strong>R</strong>eference <strong>C</strong>ounting. The problem with this kind of garbage collection is cyclic references, which have to be handled specially by the programmer with <code>weak</code> and <code>unowned</code> references to avoid memory leaks.</p>
  
  <p>But are there any other significant differences between the two? In which scenarios is one better or worse than the other?</p>