public void checkMemoryStatus(long tableContainerSize, long numRows)
  throws MapJoinMemoryExhaustionError {
    long usedMemory = memoryMXBean.getHeapMemoryUsage().getUsed();
    double percentage = (double) usedMemory / (double) maxHeapSize;
    String msg = Utilities.now() + "\tProcessing rows:\t" + numRows + "\tHashtable size:\t"
        + tableContainerSize + "\tMemory usage:\t" + usedMemory + "\tpercentage:\t" + percentageNumberFormat.format(percentage);
    console.printInfo(msg);
    if(percentage > maxMemoryUsage) {
      throw new MapJoinMemoryExhaustionError(msg);
    }
   }
Throws MapJoinMemoryExhaustionException when the JVM has consumed the
configured percentage of memory. The arguments are used simply for the error
message.

@param tableContainerSize currently table container size
@param numRows number of rows processed
@throws MapJoinMemoryExhaustionError
ql/src/java/org/apache/hadoop/hive/ql/exec/mapjoin/MapJoinMemoryExhaustionHandler.java