JConsole(可视化工具)
运行
JConsole内存监控
测试代码
import java.util.ArrayList;
import java.util.List;
public class A {
byte[] b1 = new byte[128*1024];
public static void main(String[] args) {
try {
Thread.sleep(5000);
}catch(Exception e) {
}
System.out.println("start...");
fill(1000);
}
private static void fill(int n) {
List<A> jlist = new ArrayList<A>();
for(int i=0;i<n;i++) {
try {
Thread.sleep(100);
}catch(Exception e) {
jlist.add(new A());
}
}
}
}import java.u