Copilot commented on code in PR #2786:
URL: https://github.com/apache/groovy/pull/2786#discussion_r3787521961


##########
src/main/java/org/apache/groovy/runtime/indy/SwitchPointInvalidator.java:
##########
@@ -19,6 +19,8 @@
 package org.apache.groovy.runtime.indy;
 
 import java.lang.invoke.SwitchPoint;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;

Review Comment:
   Using a strong ConcurrentHashMap for the LIVE registry keeps SwitchPoint 
keys reachable even after call sites/domains are otherwise collectible, which 
risks pinning the runtime state and growing the registry over time. Prefer a 
weak-key concurrent map (this codebase already uses 
ManagedIdentityConcurrentMap for weak domain keys).
   
   This issue also appears on line 75 of the same file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to