int oldSize = currentHeapSize; long reserved = Plan.reservedMemory(); double liveRatio = reserved / ((double) currentHeapSize);
Extent oldSize = currentHeapSize; Extent reserved = Plan.reservedMemory(); double liveRatio = reserved.toLong() / ((double) currentHeapSize.toLong());
  public static boolean considerHeapSize() {    int oldSize = currentHeapSize;    long reserved = Plan.reservedMemory();    double liveRatio = reserved / ((double) currentHeapSize);    double ratio = computeHeapChangeRatio(liveRatio);    long newSize = (long) (ratio * (double)oldSize);    if (newSize < reserved) newSize = reserved;    newSize = (newSize + (1<<20)) >> 20 << 20; // round to next megabyte    if (newSize > maxHeapSize) newSize = maxHeapSize;    if (newSize != oldSize) {      // Heap size is going to change      currentHeapSize = (int) newSize;      if (Options.verbose >= 2) {         Log.write("GC Message: Heap changed from "); Log.write((int) (oldSize / 1024));         Log.write("KB to "); Log.write((int) (newSize / 1024));         Log.writeln("KB");       }       return true;    } else {      return false;    }  }