equal
deleted
inserted
replaced
68 // TODO: If the hotspot implementation begins to have pools |
68 // TODO: If the hotspot implementation begins to have pools |
69 // dynamically created and removed, this needs to be modified. |
69 // dynamically created and removed, this needs to be modified. |
70 private String[] poolNames = null; |
70 private String[] poolNames = null; |
71 synchronized String[] getAllPoolNames() { |
71 synchronized String[] getAllPoolNames() { |
72 if (poolNames == null) { |
72 if (poolNames == null) { |
73 List pools = ManagementFactory.getMemoryPoolMXBeans(); |
73 List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans(); |
74 poolNames = new String[pools.size()]; |
74 poolNames = new String[pools.size()]; |
75 int i = 0; |
75 int i = 0; |
76 for (ListIterator iter = pools.listIterator(); |
76 for (MemoryPoolMXBean m : pools) { |
77 iter.hasNext(); |
77 poolNames[i++] = m.getName(); |
78 i++) { |
|
79 MemoryPoolMXBean p = (MemoryPoolMXBean) iter.next(); |
|
80 poolNames[i] = p.getName(); |
|
81 } |
78 } |
82 } |
79 } |
83 return poolNames; |
80 return poolNames; |
84 } |
81 } |
85 |
82 |