Mark and sweep

Java's initial garbage collection algorithm, mark and sweep used a simple two-step process:

  1.  The first step, mark, is to step through all objects that have accessible references, marking those objects as alive
  1. The second step, sweep, involves scanning the sea for any object that is not marked

As you can readily determine, the mark and sweep algorithm seems effective but is probably not very efficient due to the two-step nature of this approach. This eventually led to a Java garbage collection system with vastly improved efficiencies.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset