private static MemoryPoolMXBeanWrapper wrap(final MemoryPoolMXBean memoryPoolMXBean) {
        if (memoryPoolMXBean == null) {
            return new MemoryPoolMXBeanWrapper() {
                @Override
                public MemoryUsage getUsage() {
                    return null;
                }
            };
        } else {
            return new MemoryPoolMXBeanWrapper() {
                @Override
                public MemoryUsage getUsage() {
                    return memoryPoolMXBean.getUsage();
                }
            };
        }
    }
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