我想读取这两个值--总共分配了多少内存,以及剩余的空闲内存有多少(对于JVM是可见的,对于OS是不可见的)。
发布于 2012-09-15 05:04:49
至少在类unix系统上,你可以通过send your program a SIGQUIT得到一个javadump,它有一个关于内存的部分。
An example from the linked page:
MEMINFO subcomponent dump routine
=================================
Bytes of Heap Space Free: 365df8
Bytes of Heap Space Allocated: 400000https://stackoverflow.com/questions/12431864
复制相似问题