private void cleanup() {
        if ((++cleanupCounter & 0xFF) != 0) { // (++counter % 256) != 0
            return;
        }

        final long currentTimeNanos = System.nanoTime();
        final long lastCleanupTimeNanos = this.lastCleanupTimeNanos;
        if (currentTimeNanos - lastCleanupTimeNanos < CLEANUP_INTERVAL_NANOS ||
            !lastCleanupTimeNanosUpdater.compareAndSet(this, lastCleanupTimeNanos, currentTimeNanos)) {
            return;
        }

        for (final Iterator<AbstractEventLoopState> i = states.values().iterator(); i.hasNext();) {
            final AbstractEventLoopState state = i.next();
            final boolean remove;
            lock.lock();
            try {
                remove = state.allActiveRequests() == 0 &&
                         currentTimeNanos - state.lastActivityTimeNanos() >= CLEANUP_INTERVAL_NANOS;
            } finally {
                lock.unlock();
            }

            if (remove) {
                i.remove();
            }
        }
    }
Cleans up empty entries with no activity for more than 1 minute. For reduced overhead, we perform this
only when 1) the last clean-up was more than 1 minute ago and 2) the number of acquisitions % 256 is 0.
core/src/main/java/com/linecorp/armeria/client/DefaultEventLoopScheduler.java