protected synchronized boolean isLocked(MemoryManageable mm) {
        Set entries = locked.entrySet();
        // this can get pretty inefficient if locked is large
        for (Object entry1 : entries) {
            Map.Entry entry = (Map.Entry) entry1;
            HashSet inUse = (HashSet) entry.getValue();
            if (inUse != null && inUse.contains(mm))
                return true;
        }
        return false;
    }