long end = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); System.out.println("end = " + end); measuredObjectSize = (end - start) / ((double) estimateSize); objectSize = (int) (measuredObjectSize + 0.5);
  public static void computeObjectSize() {    System.out.println("computeObjectSize entered");    int estimateSize = 200000;    long start = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();    System.out.println("start = " + start);    Node2I2A head = new Node2I2A();    Node2I2A cur = head;    for (int i=0; i<estimateSize; i++) {      cur.cdr = new Node2I2A();      cur = cur.cdr;    }    long end = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();    System.out.println("end = " + end);    measuredObjectSize = (end - start) / ((double) estimateSize);    objectSize = (int) (measuredObjectSize + 0.5);  }