From 411cd8b883fe1fe72efb700b0f19fd7be102c265 Mon Sep 17 00:00:00 2001 From: John DeRegnaucourt Date: Sat, 22 Jun 2024 20:30:04 -0400 Subject: [PATCH] updated comment --- src/main/java/com/cedarsoftware/util/LRUCache.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/cedarsoftware/util/LRUCache.java b/src/main/java/com/cedarsoftware/util/LRUCache.java index b9f51c60..5295cc9d 100644 --- a/src/main/java/com/cedarsoftware/util/LRUCache.java +++ b/src/main/java/com/cedarsoftware/util/LRUCache.java @@ -18,9 +18,9 @@ * This class provides a thread-safe Least Recently Used (LRU) cache API that will evict the least recently used items, * once a threshold is met. It implements the Map interface for convenience. It is thread-safe via usage of * ConcurrentHashMap for internal storage. The .get(), .remove(), and .put() APIs operate in O(1) without any - * blocking. A background thread monitors and cleans up the internal Map if it exceeds capacity. In addition, if - * .put() causes the background thread to be triggered to start immediately. This will keep the size of the LRUCache - * close to capacity even with bursty loads without reducing insertion (put) performance. + * blocking. When .put() or remove() queues a call to a background cleanup thead that ensures cache.size <= capacity. + * This maintains cache size to capacity, even during bursty loads. It is not immediate, the LRUCache can exceed the + * capacity during a rapid load, however, it will quickly reduce to max capacity. *

* @author John DeRegnaucourt (jdereg@gmail.com) *