Example usage for java.lang.management GarbageCollectorMXBean getMemoryPoolNames

List of usage examples for java.lang.management GarbageCollectorMXBean getMemoryPoolNames

Introduction

In this page you can find the example usage for java.lang.management GarbageCollectorMXBean getMemoryPoolNames.

Prototype

public String[] getMemoryPoolNames();

Source Link

Document

Returns the name of memory pools that this memory manager manages.

Usage

From source file:com.thoughtworks.go.server.service.support.ServerRuntimeInformationProvider.java

private void gcInfo(List<GarbageCollectorMXBean> garbageCollectorMXBeans, InformationStringBuilder builder) {
    builder.addSection("GC information");
    for (GarbageCollectorMXBean gcBean : garbageCollectorMXBeans) {
        builder.append(String.format("%s %s %s : %s (Count : Time)\n", gcBean.getName(),
                Arrays.toString(gcBean.getMemoryPoolNames()), gcBean.getCollectionCount(),
                gcBean.getCollectionTime()));
    }/*w  w  w. j  ava  2  s  .co m*/
}