摘要:
threadlocal里面使用了一个存在弱引用的map,当释放掉threadlocal的强引用以后,map里面的value却没有被回收.而这块value永远不会被访问到了. 所以存在着内存泄露. ** 最好的做法是将调用threadlocal的remove方法.**: 把当前ThreadLocal从 阅读全文
摘要:
Java's ThreadLocals make certain things easy, but special care must be taken to make sure they are removed from threads when they are no longer needed 阅读全文