This is an automated email from the ASF dual-hosted git repository.

Aias00 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new a89459bf29 refactor(common): deprecate unused memory-safe lru map. 
(#7553)
a89459bf29 is described below

commit a89459bf29e6b7d074a954754dd36cd60999a8e8
Author: redyyang <[email protected]>
AuthorDate: Mon Oct 12 22:50:01 2026 +0800

    refactor(common): deprecate unused memory-safe lru map. (#7553)
---
 RELEASE-NOTES.md                                           | 14 ++++++++++++++
 .../org/apache/shenyu/common/cache/MemorySafeLRUMap.java   |  6 ++++++
 2 files changed, 20 insertions(+)

diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 2278e5f5f3..65a7892c91 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -2,6 +2,20 @@
 
 ### API Changes
 
+- `MemorySafeLRUMap` is deprecated since 2.7.2. The class, public constructors,
+  serialization identifier and existing behavior are retained for downstream
+  source and binary compatibility. No removal release is scheduled; a future
+  removal requires a public API compatibility review and advance release 
notice.
+  For caches accessed through the `Map` API, consider the existing
+  `WindowTinyLFUMap` with an explicit maximum entry count, for example
+  `new WindowTinyLFUMap<>(maximumEntries)`. Choose that count for the 
application's
+  working set: the old `maxFreeMemory` argument is a free-memory threshold in
+  bytes, not an entry count. Review the different eviction policy, non-null
+  key/value requirements and absence of `LRUMap`-specific operations. Code that
+  relies on memory-pressure eviction should retain `MemorySafeLRUMap` until an
+  equivalent policy is chosen; `WindowTinyLFUMap` does not implement that
+  threshold. (#7444)
+
 - `DiscoveryUpstreamDataSubscriber#unSubscribe(DiscoverySyncData)` has been 
replaced by `unSubscribe(DiscoveryUpstreamKey)`. Downstream implementations 
must update their method signature; this is a source- and binary-incompatible 
change. (#7289)
 
 ### Behavior Changes
diff --git 
a/shenyu-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeLRUMap.java
 
b/shenyu-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeLRUMap.java
index cb95a5dfa7..6698376ac3 100644
--- 
a/shenyu-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeLRUMap.java
+++ 
b/shenyu-common/src/main/java/org/apache/shenyu/common/cache/MemorySafeLRUMap.java
@@ -28,7 +28,13 @@ import java.util.Map;
  * is that it handles memory issues via {@link 
org.apache.shenyu.common.concurrent.MemoryLimitCalculator}.
  *
  * <p>Note: this class is not thread safe! see 
https://github.com/apache/shenyu/issues/3929
+ *
+ * @deprecated since 2.7.2, retained for downstream compatibility. For bounded 
caches accessed through
+ *             the {@link Map} API, consider {@link WindowTinyLFUMap} with an 
explicit maximum entry count.
+ *             Review its different eviction policy and lack of this class's 
free-memory threshold
+ *             and {@link LRUMap}-specific operations before migrating.
  */
+@Deprecated(since = "2.7.2")
 @NotThreadSafe
 public class MemorySafeLRUMap<K, V> extends LRUMap<K, V> {
 

Reply via email to