Example usage for java.lang.management MemoryManagerMXBean getMemoryPoolNames

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

Introduction

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

Prototype

public String[] getMemoryPoolNames();

Source Link

Document

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

Usage

From source file:org.code_house.service.jolokia.Jolokia.java

public static void main(String[] args) throws MalformedObjectNameException {
    J4pClient client = new J4pClient("http://127.0.0.1:8040/jolokia");

    MemoryManagerMXBean bean = Jolokia.newMBeanProxy(client,
            new ObjectName("java.lang:type=MemoryManager,name=CodeCacheManager"), MemoryManagerMXBean.class);
    System.out.println(Arrays.toString(bean.getMemoryPoolNames()));
}