美文网首页
ThreadLocal内存泄漏测试

ThreadLocal内存泄漏测试

作者: 呆呆猿 | 来源:发表于2020-06-01 00:05 被阅读0次

public static void test1(){

new Thread(() -> {

for (int i =0; i <100; i++) {

ThreadLocal threadLocal =new ThreadLocal<>();

                threadLocal.set(new int[1014 *1024]);

                System.out.println(threadLocal.get());

//                threadLocal.remove();

            }

}).start();

    }

相关文章

网友评论

      本文标题:ThreadLocal内存泄漏测试

      本文链接:https://www.haomeiwen.com/subject/fvbdzhtx.html