private void removeStaleReferences() {
        var staleReference = (LabelWeakReference) referenceQueue.poll();
        if (staleReference == null) {
            return;
        }

        byString.remove(staleReference.stringKey, staleReference);
        byNumeric.remove(staleReference.numericKey, staleReference);

        staleReference = (LabelWeakReference) referenceQueue.poll();
        if (staleReference == null) {
            return;
        }

        byString.remove(staleReference.stringKey, staleReference);
        byNumeric.remove(staleReference.numericKey, staleReference);
    }
Creates a label cache.

@param lockStripes number of lock stripes, should be proportional to the number of threads using the cache.
@param smallIndexSize size of a cache used to store pre-computed labels for small index labels.
vespajlib/src/main/java/com/yahoo/tensor/impl/LabelCache.java