private String makeListOfActiveReferences() {
        final StringBuilder builder = new StringBuilder();
        builder.append("[");
        synchronized (activeReferences) {
            for (var activeReference : activeReferences.entrySet()) {
                builder.append(" ");
                builder.append(Arrays.toString(activeReference.getKey().getStackTrace()));
            }
        }
        builder.append(" ]");
        return builder.toString();
    }
Does reference counting by putting stacktraces in a map together with an optional context.
Intended only for debugging as it is slow.
Used if system property jdisc.debug.resources=stack

@author baldersheim
jdisc_core/src/main/java/com/yahoo/jdisc/refcount/DebugReferencesWithStack.java