[ 
https://issues.apache.org/jira/browse/SLING-11149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17751312#comment-17751312
 ] 

Joerg Hoh commented on SLING-11149:
-----------------------------------

[~rombert]: I wonder what you mean with improvement 1: "any cleanup operation". 
In my opinion it does not make sense to log (and count) cleanup operations, 
which did not perform any actual work (that means: No threadlocal was removed). 

 

> Expose information about cleaned up leftover ThreadLocal values 
> ----------------------------------------------------------------
>
>                 Key: SLING-11149
>                 URL: https://issues.apache.org/jira/browse/SLING-11149
>             Project: Sling
>          Issue Type: New Feature
>          Components: Commons
>            Reporter: Robert Munteanu
>            Priority: Major
>             Fix For: Commons Threads 3.3.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> As discussed in SLING-10831, the ThreadLocal cleanup feature is valuable as a 
> safeguard for code that might lead to hard-to-diagnose memory leaks.
> At the same time, it does not let developers know when a leak has been 
> prevented. We should improve this. The following improvements can be made:
> # log with a {{WARN}} level any cleanup operation. Care must be taken to not 
> overflow the logs, so maybe a way of only reporting a cleanup for a certain 
> key once can be used (memory-bound)
> # expose a counter that reports how many cleanup operations have been 
> performed by a given thread pool



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to