public static long getDirectMemoryCount() {
        try {
            Long value = (Long)mbeans.getAttribute(directPool, "Count");
            return value == null ? -1 : value;
        } catch (JMException ex) {
            Logger.getLogger(MemoryUtils.class.getName()).log(Level.SEVERE, "Error retrieving Count", ex);
            return -1;
        }
    }
@return the number of direct buffer used
jme3-core/src/main/java/com/jme3/util/MemoryUtils.java