code: public static String getMemoryPoolStatsAsString(List<MemoryPoolMXBean> poolBeans) {
  		StringBuilder bld = new StringBuilder("Off-heap pool stats: ");
  		int count = 0;
  		
  		for (MemoryPoolMXBean bean : poolBeans) {
  			if (bean.getType() == MemoryType.NON_HEAP) {
  				if (count > 0) {
  					bld.append(", ");
  				}
  				count++;
  
  				MemoryUsage usage = bean.getUsage();
  				long used = usage.getUsed() >> 20;
  				long committed = usage.getCommitted() >> 20;
  				long max = usage.getMax() >> 20;
  				
  				bld.append('[').append(bean.getName()).append(": ");
  				bld.append(used).append('/').append(committed).append('/').append(max);
  				bld.append(" MB (used/committed/max)]");
  			}
  		}
  
  		return bld.toString();
  	}
docs: Gets the memory pool statistics from the JVM.
  
  @param poolBeans The collection of memory pool beans.
  @return A string denoting the names and sizes of the memory pools.