blackdrag commented on code in PR #2868:
URL: https://github.com/apache/groovy/pull/2868#discussion_r3920659834
##########
subprojects/groovy-servlet/src/main/java/groovy/servlet/TemplateServlet.java:
##########
@@ -187,7 +187,7 @@ public String toString() {
* Create new TemplateServlet.
*/
public TemplateServlet() {
- this.cache = new WeakHashMap<String, TemplateCacheEntry>();
+ this.cache = new ConcurrentHashMap<String, TemplateCacheEntry>();
Review Comment:
I agree that the concurrency issue is fixed very well with
ConcurrentHashMap. But even if done wrong, the idea before was a memory
sensitive cache. Your solution is removing that idea. Why not a
Weak/SoftReference for the value? or a LRUCache or ConcurrentLinkedHashMap
--
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]