最近我遇到了JVM内存分配问题。
根据GC log和jvisulvm,我的应用程序正在创建一个ton int数组。
...
15.587: [GC (Allocation Failure) [PSYoungGen: 8387648K->192K(8388096K)] 8413385K->25945K(16776704K), 0.0004254 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
15.592: [GC (Allocation Failure) [PSYoungGen: 8387776K->192K(8388096K)] 8413529K->26001K(16776704K), 0.0003679 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
15.596: [GC (Allocation Failure) [PSYoungGen: 8387776K->96K(8388096K)] 8413585K->25929K(16776704K), 0.0004090 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
15.602: [GC (Allocation Failure) [PSYoungGen: 8387680K->128K(8388096K)] 8413513K->25993K(16776704K), 0.0004101 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
15.606: [GC (Allocation Failure) [PSYoungGen: 8387712K->128K(8388096K)] 8413577K->26025K(16776704K), 0.0003756 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
15.611: [GC (Allocation Failure) [PSYoungGen: 8387712K->160K(8388096K)] 8413609K->26097K(16776704K), 0.0003965 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
15.626: [GC (Allocation Failure) [PSYoungGen: 8387744K->128K(8388096K)] 8413681K->26105K(16776704K), 0.0004195 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
...
我在整个代码库中搜索了" new int []"并且发现只有两个分配,我很确定它们只运行一次。这让我相信数组是在某个库或JRE中分配的。
如何找到这些分配的根?