private double calculateUsage(MemoryUsage memoryUsage) {
        if (memoryUsage == null) {
            return UNCOLLECTED_USAGE;
        }
        long max = memoryUsage.getMax() == -1 ? memoryUsage.getCommitted() : memoryUsage.getMax();
        if (max == -1 || max == 0) {
            return UNCOLLECTED_USAGE;
        }
        return memoryUsage.getUsed() / (double) max;
    }
Metric for detailed memory usages

@author dawidmalina
@author HyunGil Jeong
agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/monitor/metric/memory/DefaultDetailedMemoryMetric.java