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();
}