{"comment":{"url":"https://api.github.com/repos/brettwooldridge/HikariCP/comments/11135662","html_url":"https://github.com/brettwooldridge/HikariCP/commit/f3aee853c0ada6932f0ddba0d1d25ecb61b273b6#commitcomment-11135662","id":11135662,"user":{"login":"jnehlmeier","id":1703797,"avatar_url":"https://avatars.githubusercontent.com/u/1703797?v=3","gravatar_id":"","url":"https://api.github.com/users/jnehlmeier","html_url":"https://github.com/jnehlmeier","followers_url":"https://api.github.com/users/jnehlmeier/followers","following_url":"https://api.github.com/users/jnehlmeier/following{/other_user}","gists_url":"https://api.github.com/users/jnehlmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/jnehlmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnehlmeier/subscriptions","organizations_url":"https://api.github.com/users/jnehlmeier/orgs","repos_url":"https://api.github.com/users/jnehlmeier/repos","events_url":"https://api.github.com/users/jnehlmeier/events{/privacy}","received_events_url":"https://api.github.com/users/jnehlmeier/received_events","type":"User","site_admin":false},"position":13,"line":60,"path":"src/main/java/com/zaxxer/hikari/util/ConcurrentBag.java","commit_id":"f3aee853c0ada6932f0ddba0d1d25ecb61b273b6","created_at":"2015-05-11T14:54:58Z","updated_at":"2015-05-11T14:54:58Z","body":"You probably have introduced a memory leak here because you never call ThreadLocal.set(null) or ThreadLocal.remove().\r\n\r\nIf you don't believe then you might want to take a look at https://github.com/dropwizard/metrics/issues/742 which is basically the same situation. \r\n\r\nSo I think you should keep the WeakReference. For Tomcat is actually doesn't matter because they clean up values via reflection after logging that severe warning. Other servers don't do that and will leak memory then."}}