It works on best effort basis. If multi-threaded calls involved it may evict all elements, but it's unlikely.
358007
private void evictMap(SampleableConcurrentHashMap<?, ?> map, int triggeringEvictionSize, int afterEvictionSize) {
        map.purgeStaleEntries();
        int mapSize = map.size();
        if (mapSize - triggeringEvictionSize >= 0) {
            for (SampleableConcurrentHashMap.SamplingEntry entry : map.getRandomSamples(mapSize - afterEvictionSize)) {
                map.remove(entry.getEntryKey());
            }
        }
    }
415255
private synchronized boolean deleteReceiveAllowedThread()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "deleteReceiveAllowedThread");

        if (_receiveAllowedThread.isMarkedForUpdate())
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "deleteReceiveAllowedThread", Boolean.FALSE);
            return false;
        }

        _receiveAllowedThread = null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "deleteReceiveAllowedThread", Boolean.TRUE);
        return true;
    }
146647
private void evict() {
    if (windowSize <= maxWindow) {
      return;
    }

    Node candidate = headWindow.next;
    windowSize--;

    candidate.remove();
    candidate.queue = PROBATION;
    candidate.appendToTail(headProbation);

    if (data.size() > maximumSize) {
      Node victim = headProbation.next;
      Node evict = admittor.admit(candidate.key, victim.key) ? victim : candidate;
      data.remove(evict.key);
      evict.remove();

      policyStats.recordEviction();
    }
  }
1110281
boolean flush() {
    if (!dirty)
      return true;

    acquireExclusiveLock();
    try {

      final long timer = OProfiler.getInstance().startChrono();

      // FORCE THE WRITE OF THE BUFFER
      for (int i = 0; i < FORCE_RETRY; ++i) {
        try {
          buffer.force();
          dirty = false;
          break;
        } catch (Exception e) {
          OLogManager.instance().debug(this,
              "Cannot write memory buffer to disk. Retrying (" + (i + 1) + "/" + FORCE_RETRY + ")...");
          OMemoryWatchDog.freeMemory(FORCE_DELAY);
        }
      }

      if (dirty)
        OLogManager.instance().debug(this, "Cannot commit memory buffer to disk after %d retries", FORCE_RETRY);
      else
        OProfiler.getInstance().updateCounter("system.file.mmap.pagesCommitted", 1);

      OProfiler.getInstance().stopChrono("system.file.mmap.commitPages", timer);

      return !dirty;

    } finally {
      releaseExclusiveLock();
    }
  }
640696
private void process(long key) {
    IntPriorityQueue times = accessTimes.get(key);

    int lastAccess = times.dequeueInt();
    boolean found = data.remove(lastAccess);

    if (times.isEmpty()) {
      data.add(infiniteTimestamp--);
      accessTimes.remove(key);
    } else {
      data.add(times.firstInt());
    }
    if (found) {
      policyStats.recordHit();
    } else {
      policyStats.recordMiss();
      if (data.size() > maximumSize) {
        evict();
      }
    }
  }
61343
final boolean deactivate() {
        long c = callId;
        if (c <= 0) {
            return false;
        }
        if (CALL_ID.compareAndSet(this, c, -c)) {
            return true;
        }
        if (callId > 0) {
            throw new IllegalStateException("Operation concurrently re-activated while executing deactivate(). " + this);
        }
        return false;
    }
770897
@GuardedBy("evictionLock")
    void drainWriteBuffer() {
        for (int i = 0; i < WRITE_BUFFER_DRAIN_THRESHOLD; i++) {
            final Runnable task = writeBuffer.poll();
            if (task == null) {
                break;
            }
            task.run();
        }
    }
1250050
private void onMiss(long key) {
    Node node = new Node(key, Status.WINDOW_PROBATION);
    node.appendToTail(headWindowProbation);
    data.put(key, node);
    sizeWindow++;
    evict();
  }
957003
public boolean isApplicable(Call call) {
        return when.getPredicate().test(call) && (actionSequence.size() == 0 || exceededAction != null || actionSequence.size() > appliedTimes);
    }
1026310
protected boolean isEvictionRequired() {
        boolean evictionRequired = false;
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            int size = primaryTable.size() + secondaryTable.size() + tertiaryTable.size();
            Tr.debug(tc, "The current cache size is " + size + "( " + primaryTable.size() + ", " + secondaryTable.size() + ", " + tertiaryTable.size() + ")");
        }

        if (entryLimit != 0 && entryLimit != Integer.MAX_VALUE) {
            int size = primaryTable.size() + secondaryTable.size() + tertiaryTable.size();

            // If the cache size is greater than its limit, time to purge...
            if (size > entryLimit) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "The cache size is " + size + "( " + primaryTable.size() + ", " + secondaryTable.size() + ", " + tertiaryTable.size()
                                 + ") which is greater than the cache limit of " + entryLimit + ".");
                evictionRequired = true;
            }
        }
        return evictionRequired;
    }
805538
protected synchronized void evictStaleEntries() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            int size = primaryTable.size() + secondaryTable.size() + tertiaryTable.size();
            Tr.debug(tc, "The current cache size is " + size + "( " + primaryTable.size() + ", " + secondaryTable.size() + ", " + tertiaryTable.size() + ")");
        }

        tertiaryTable = secondaryTable;
        secondaryTable = primaryTable;
        primaryTable = Collections.synchronizedMap(new BoundedHashMap(this.entryLimit));

    }
48132
function (callback, a, b, c, d, e) {
	    var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;

	    ReactDefaultBatchingStrategy.isBatchingUpdates = true;

	    // The code is written this way to avoid extra allocations
	    if (alreadyBatchingUpdates) {
	      callback(a, b, c, d, e);
	    } else {
	      transaction.perform(callback, null, a, b, c, d, e);
	    }
	  }
202724
private boolean doNextBalanceOp(TreeSet<LoadPair> loadSet) {
        LoadPair mostLoaded = loadSet.pollLast();
        LoadPair leastLoaded = loadSet.pollFirst();

        try {
            //Perfection
            if (mostLoaded.tokens.size() == leastLoaded.tokens.size()) return false;
            //Can't improve on off by one, just end up off by one again
            if (mostLoaded.tokens.size() == (leastLoaded.tokens.size() + 1)) return false;
            int token = mostLoaded.tokens.pollFirst();
            leastLoaded.tokens.add(token);
        } finally {
            loadSet.add(mostLoaded);
            loadSet.add(leastLoaded);
        }
        return true;
    }
1366260
boolean onSplitWork(int bytesMoved) {
        if (_splitTargetRemaining <= 0) {
            _splitTargetRemaining = _splitTargetSize - bytesMoved;
            return true;
        } else {
            _splitTargetRemaining -= bytesMoved;
            return false;
        }
    }
1025453
private FileEntry evict() {
      if (configuration.maxEntries() > 0) {
         synchronized (entries) {
            if (entries.size() > configuration.maxEntries()) {
               Iterator<FileEntry> it = entries.values().iterator();
               FileEntry fe = it.next();
               it.remove();
               return fe;
            }
         }
      }
      return null;
   }
973446
public boolean hasCheckMultiActions() {

        Iterator<CmsListMultiAction> it = m_multiActions.elementList().iterator();
        while (it.hasNext()) {
            CmsListMultiAction action = it.next();
            if (!(action instanceof CmsListRadioMultiAction)) {
                return true;
            }
        }
        return false;
    }
569985
public boolean offer(long inUniqueId, TransactionInfoBaseMessage in)
    {
        ReplayEntry found = m_replayEntries.get(inUniqueId);

        if (in instanceof Iv2EndOfLogMessage) {
            m_mpiEOLReached = true;
            return true;
        }

        if (in instanceof MultiPartitionParticipantMessage) {
            //--------------------------------------------
            // DRv1 path, mark for future removal
            /*
             * DR sends multiple @LoadMultipartitionTable proc calls with the
             * same txnId, which is the snapshot txnId. For each partition,
             * there is a sentinel paired with the @LoadMultipartitionTable
             * call. Dedupe the sentinels the same way as we dedupe fragments,
             * so that there won't be sentinels end up in the sequencer where
             * matching fragments are deduped.
             */
            if (inUniqueId <= m_lastPolledFragmentUniqueId) {
                return true;
            }
            //--------------------------------------------
            if (found == null) {
                ReplayEntry newEntry = new ReplayEntry();
                newEntry.m_sentinelUniqueId = inUniqueId;
                m_replayEntries.put(inUniqueId, newEntry);
            }
            else {
                found.m_sentinelUniqueId = inUniqueId;
                assert(found.isReady());
            }
        }
        else if (in instanceof FragmentTaskMessage) {
            // already sequenced
            if (inUniqueId <= m_lastPolledFragmentUniqueId) {
                return false;
            }
            FragmentTaskMessage ftm  = (FragmentTaskMessage)in;
            if (found == null) {
                ReplayEntry newEntry = new ReplayEntry();
                newEntry.m_firstFragment = ftm;
                m_replayEntries.put(inUniqueId, newEntry);
            }
            else if (found.m_firstFragment == null) {
                found.m_firstFragment = ftm;
                assert(found.isReady());
            }
            else {
                found.addQueuedMessage(ftm);
            }
        }
        else if (in instanceof CompleteTransactionMessage) {
            // don't sequence CompleteTranscationMessage, throw them to scheduler directly
            return false;
        }
        else {
            //--------------------------------------------
            // DRv1 path, mark for future removal
            if (dedupe(inUniqueId, in) != null) {
                // Ignore an already seen txn
                return true;
            }
            //--------------------------------------------
            updateLastSeenUniqueId(inUniqueId, in);

            if (m_replayEntries.isEmpty() || !m_replayEntries.lastEntry().getValue().hasSentinel()) {
                // not-blocked work; rejected and not queued.
                return false;
            }
            else {
                // queued the message with the newest replayEntry
                m_replayEntries.lastEntry().getValue().addQueuedMessage(in);
            }
        }
        return true;
    }