Copy

Mark and Copy algorithms are very similar to the Mark and Compact as they too relocate all live objects. The important difference is that the target of relocation is a different memory region as a new home for survivors. Mark and Copy approach has some advantages as copying can occur simultaneously with marking during the same phase. The disadvantage is the need for one more memory region, which should be large enough to accommodate survived objects.

Java GC Mark and Copy Collector

What if GC does not help?

The whole idea of GC depends on the expectation that the programmers will not keep active references to the objects that they no longer use.
However, as practice shows, it is extremely easy to accidentally leave behind some data. This situation is called a memory leak, and typically leads to increased GC overhead, and often ends up in the JVM dying with an OutOfMemoryError. Plumbr detects such situations and can show you what’s leaking.

Read more