double finalHeapSize = getHeapSize();
getHeapSize();
  public static void main(String[] args) throws Exception {      // ------ Compute initial heap size (inaccuracy subject to compilation) --------      double initialHeapSize = getHeapSize();      // ------ Test weak references -----------      System.out.println("\nChecking weak references and reference queue");      ReferenceQueue wrq = new ReferenceQueue();      allocateUntilNextGC();      Reference [] wra = allocateReferenceArray(WEAK, 0.5 * initialHeapSize, wrq);      double weakAvail = checkReferenceArray(wra, wrq);      check("Fraction of weak references before GC still live = " + weakAvail, (weakAvail == 1.0));      allocateDiscard(0.75 * initialHeapSize);      weakAvail = checkReferenceArray(wra, wrq);      check("Fraction of weak references after  GC still live = " + weakAvail, (weakAvail == 0.0));      // ------ Test soft references -----------      System.out.println("\nChecking soft references and reference queue");      ReferenceQueue srq = new ReferenceQueue();      allocateUntilNextGC();      Reference [] sra = allocateReferenceArray(SOFT, 0.75 * initialHeapSize, srq);      double softAvail = checkReferenceArray(sra, srq);      check("Fraction of soft references before GC still live = " + softAvail, (softAvail == 1.0));      allocateHold(0.5 * initialHeapSize);      softAvail = checkReferenceArray(sra, srq);      check("Fraction of soft references after  GC still live = " + softAvail,             (softAvail >= 0.00) && (softAvail <= 0.67),            ((softAvail >= 0.33) && (softAvail <= 0.66)) ? GOOD : POOR);      // ------ Finish up -----------      System.out.println();      double finalHeapSize = getHeapSize();      System.out.print("\nOverall: ");      System.out.println((failCount == 0) ? "SUCCESS" : (failCount + " FAILURES"));  }