public class GC {

  private static void small() {
    for (int i = 0; i < 1024; ++i) {
      byte[] a = new byte[4 * 1024];
    }
  }

  private static void medium() {
    for (int i = 0; i < 8; ++i) {
      Object[] array = new Object[32];
      for (int j = 0; j < 32; ++j) {
        array[j] = new byte[32 * 1024];
      }
    }
  }

  private static void large() {
    for (int i = 0; i < 8; ++i) {
      byte[] a = new byte[16 * 1024 * 1024];
    }

    for (int i = 0; i < 8; ++i) {
      byte[] a = new byte[16 * 1024 * 1024];
      for (int j = 0; j < 32; ++j) {
        byte[] b = new byte[32 * 1024];
      }
    }
  }

  public static void main(String[] args) {
    Object[] array = new Object[1024 * 1024];
    array[0] = new Object();

    small();

    array[1] = new Object();

    medium();

    array[2] = new Object();

    large();

    array[0].toString();
    array[1].toString();
    array[2].toString();
  }

}

@@ -624,16 +624,527 @@
  %7D%0A  %7D%0A%0A
+  private static void lifetime1(boolean predicate) %7B%0A    if (predicate) %7B%0A      Object a = null;%0A    %7D%0A%0A    small();%0A  %7D%0A%0A  private static void lifetime2(boolean predicate) %7B%0A    if (predicate) %7B%0A      int a = 42;%0A    %7D else %7B%0A      Object a = null;%0A    %7D%0A%0A    small();%0A  %7D%0A%0A  private static void lifetime3(boolean predicate) %7B%0A    int i = 2;%0A    if (predicate) %7B%0A      Object a = null;%0A    %7D else %7B%0A      Object a = null;%0A    %7D%0A%0A    do %7B%0A      small();%0A      int a = 42;%0A      -- i;%0A    %7D while (i %3E= 0);%0A  %7D%0A%0A
   public
@@ -1431,16 +1431,148 @@
 tring();
+%0A%0A    lifetime1(true);%0A    lifetime1(false);%0A%0A    lifetime2(true);%0A    lifetime2(false);%0A%0A    lifetime3(true);%0A    lifetime3(false);
 %0A  %7D%0A%0A%7D%0A

add object lifetime tests to GC.java, which currently fail with JIT