public static long availableMemory(){
  return RUNTIME.freeMemory() + (RUNTIME.maxMemory() - RUNTIME.totalMemory());
}

public static long availableMemory ( ) { return RUNTIME . freeMemory ( ) + ( RUNTIME . maxMemory ( ) - RUNTIME . totalMemory ( ) ) ; }
returns the amount of available memory ( free memory plus never allocated memory ) .
