public boolean memoryIsLow(){
  m_MemoryUsage=m_MemoryMXBean.getHeapMemoryUsage();
  if (isEnabled()) {
    long lowThreshold=(long)(0.2 * m_MemoryUsage.getMax());
    if (lowThreshold < LOW_MEMORY_MINIMUM) {
      lowThreshold=LOW_MEMORY_MINIMUM;
    }
    long avail=m_MemoryUsage.getMax() - m_MemoryUsage.getUsed();
    return (avail < lowThreshold);
  }
 else {
    return false;
  }
}

public boolean memoryIsLow ( ) { m_MemoryUsage = m_MemoryMXBean . getHeapMemoryUsage ( ) ; if ( isEnabled ( ) ) { long lowThreshold = ( long ) ( 0.2 * m_MemoryUsage . getMax ( ) ) ; if ( lowThreshold < LOW_MEMORY_MINIMUM ) { lowThreshold = LOW_MEMORY_MINIMUM ; } long avail = m_MemoryUsage . getMax ( ) - m_MemoryUsage . getUsed ( ) ; return ( avail < lowThreshold ) ; } else { return false ; } }
checks to see if memory is running low . low is defined as available memory less than 20 % of max memory .
