package de.avatic.taricdb.helper.stats;

public class HeapStat {
	
	public static String getHeapUtilization() {

        long maxMemory = Runtime.getRuntime().maxMemory() / 1024 / 1024;
        long allocatedMemory = Runtime.getRuntime().totalMemory() / 1024 / 1024;
        long freeMemory = Runtime.getRuntime().freeMemory() / 1024 / 1024;
        
        return "[ Memory used: " + (allocatedMemory - freeMemory) + " MB | total utilization: " + ((((allocatedMemory - freeMemory))*100)/maxMemory) + "%]";
	}

}
