question: public boolean isOutOfMemory ( ) { try { Thread . sleep ( m_SleepTime ) ; } catch ( InterruptedException ex ) { ex . printStackTrace ( ) ; } m_MemoryUsage = m_MemoryMXBean . getHeapMemoryUsage ( ) ; if ( isEnabled ( ) ) { long avail = m_MemoryUsage . getMax ( ) - m_MemoryUsage . getUsed ( ) ; if ( avail > OUT_OF_MEMORY_THRESHOLD ) { long num = ( avail - OUT_OF_MEMORY_THRESHOLD ) / 5242880 + 1 ; m_SleepTime = ( long ) ( 2.0 * ( Math . log ( num ) + 2.5 ) ) ; if ( m_SleepTime > MAX_SLEEP_TIME ) { m_SleepTime = MAX_SLEEP_TIME ; } } return avail < OUT_OF_MEMORY_THRESHOLD ; } else { return false ; } }
target:  checks if there's still enough memory left by checking whether there is still a 50MB margin between getUsed() and getMax(). if ENABLED is true, then false is returned always. updates the MemoryUsage variable before checking.