class SimpleObject{
NormalObject obj1;
NestedCustomObject obj2;
List<Obj extends Timer> threadObj1;
List<Obj extends Thread> threadObj2;
}这样的Thread obj正在运行。
如何手动发布这样的obj (SimpleObject obj)?
如果是System.gc(),obj=null会自动发布它吗?
更详细的
After assign null value to the object and call System.gc(), program suspend on the thread again whill debuging
看来线程obj不会自动释放。
发布于 2015-11-23 14:46:25
System.gc()是对JVM的提示,JVM可能会选择忽略它。没有办法强制垃圾收集。
https://stackoverflow.com/questions/33873704
复制相似问题