Back to index

munin  2.0.1
MemoryAllocatedNonHeap.java
Go to the documentation of this file.
00001 package org.munin.plugin.jmx;
00002 
00003 import java.lang.management.ManagementFactory;
00004 import java.lang.management.MemoryMXBean;
00005 
00006 import org.munin.plugin.jmx.AbstractAnnotationGraphsProvider.Graph;
00007 
00008 @Graph(title = "Allocated Non-Heap Memory", vlabel = "bytes", args = "--base 1024 -l 0", info = "The current memory usage of non-heap memory that is used by the Java virtual machine.")
00009 public class MemoryAllocatedNonHeap extends AbstractMemoryUsageProvider {
00010 
00011        public MemoryAllocatedNonHeap(Config config) {
00012               super(config);
00013        }
00014 
00015        @Override
00016        protected void prepareValues() throws Exception {
00017               memoryUsage = ManagementFactory.newPlatformMXBeanProxy(getConnection(),
00018                             ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class)
00019                             .getNonHeapMemoryUsage();
00020        }
00021 
00022        public static void main(String args[]) {
00023               runGraph(args);
00024        }
00025 }