关于虚拟内存的问题
Java程序可以通过指定JVM参数打印heap和GC的信息,我的一段log如下(jre.1.4.2):
Heap
def new generation total 59008K, used 42K [0x10010000, 0x14010000, 0x14010000)
eden space 52480K, 0% used [0x10010000, 0x1001a9d8, 0x13350000)
from space 6528K, 0% used [0x139b0000, 0x139b0000, 0x14010000)
to space 6528K, 0% used [0x13350000, 0x13350000, 0x139b0000)
tenured generation total 6100K, used 3659K [0x14010000, 0x14605000, 0x30010000)
the space 6100K, 59% used [0x14010000, 0x143a2c28, 0x143a2e00, 0x14605000)
compacting perm gen total 4864K, used 4718K [0x30010000, 0x304d0000, 0x34010000)
the space 4864K, 97% used [0x30010000, 0x304aba68, 0x304abc00, 0x304d0000)
} , 0.2393164 secs]
log中显示我的程序一共使用了大约70M(59+6+5)heap中的8M(3.6+4.7)内存,
但是在windows task manager中显示java.exe所占用的内存为:
内存使用231M,高峰内存使用315M,虚拟内存使用476M,我的程序已经运行了近2个星期。
我的问题是为什么虚拟内存会一直增加不会被释放呢?