code: private long getNumberOfAllocatedChunks(Object arena, String chunkListFieldName)
  			throws NoSuchFieldException, IllegalAccessException {
  
  		// Each PoolArena<ByteBuffer> stores its allocated PoolChunk<ByteBuffer>
  		// instances grouped by usage (field qInit, q000, q025, etc.) in
  		// PoolChunkList<ByteBuffer> lists. Each list has zero or more
  		// PoolChunk<ByteBuffer> instances.
  
  		// Chunk list of arena
  		Field chunkListField = arena.getClass().getSuperclass()
  				.getDeclaredField(chunkListFieldName);
  		chunkListField.setAccessible(true);
  		Object chunkList = chunkListField.get(arena);
  
  		// Count the chunks in the list
  		Field headChunkField = chunkList.getClass().getDeclaredField("head");
  		headChunkField.setAccessible(true);
  		Object headChunk = headChunkField.get(chunkList);
  
  		if (headChunk == null) {
  			return 0;
  		} else {
  			int numChunks = 0;
  
  			Object current = headChunk;
  
  			while (current != null) {
  				Field nextChunkField = headChunk.getClass().getDeclaredField("next");
  				nextChunkField.setAccessible(true);
  				current = nextChunkField.get(current);
  				numChunks++;
  			}
  
  			return numChunks;
  		}
  	}
docs: Returns the number of allocated bytes of the given arena and chunk list.
  
  @param arena              Arena to gather statistics about.
  @param chunkListFieldName Chunk list to check.
  
  @return Number of total allocated bytes by this arena.
  
  @throws NoSuchFieldException   Error getting the statistics (should not
  happen when the Netty version stays the
  same).
  @throws IllegalAccessException Error getting the statistics (should not
  happen when the Netty version stays the
  same).