public static String formatUsedMemory ( ) { Runtime runtime = Runtime . getRuntime ( ) ; long usedMemory = Math . max ( 0 , runtime . totalMemory ( ) - runtime . freeMemory ( ) ) ; return MemoryUnitFormat . getMemoryUnitInstance ( ) . format ( usedMemory ) ; }
Formats the currently used memory in human readable format .