views:

35

answers:

2

I need code for the memory monitor using Swing which displays the memory pool contents such as code cache, eden space, survivor space, perm gen, temred gen, tenured space and plots memory usage graph.

+1  A: 

You can use the ManagementFactory class to get the information you need.

Joachim Sauer
A: 

You can also use Runtime class to get basic memory information:

long totalMemory = Runtime.getRuntime().totalMemory();
long freeMemory = Runtime.getRuntime().freeMemory();
long maxMemory = Runtime.getRuntime().maxMemory();
denis_k