ThreadLocal内存泄漏测试

2020-06-01  本文已影响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();

    }

上一篇 下一篇

猜你喜欢

热点阅读