johnament commented on a change in pull request #409: CXF-7710: ClientImpl is 
memory-leak prone
URL: https://github.com/apache/cxf/pull/409#discussion_r184449068
 
 

 ##########
 File path: core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
 ##########
 @@ -1083,12 +1087,29 @@ public void clear() {
         }
     }
 
-
     public void setExecutor(Executor executor) {
         if (!SynchronousExecutor.isA(executor)) {
             this.executor = executor;
         }
     }
 
+    /**
+     * Returns the current thread name. As this value will be used as a key in 
a {@link WeakHashMap},
+     * we should use the String constructor for avoiding scenarios where 
strong references are kept
+     * to the string names causing that the map entries can't be garbage 
collected.
+     * @return
+     */
+    private String getThreadName() {
 
 Review comment:
   Also, you're not going to want to `new` the string each time, for 
performance reasons.  Can the methods that call this reduce the number of times 
they call it?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to