统计JAVA对象大小的利器RamUsageEstimator
Posted 流子
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了统计JAVA对象大小的利器RamUsageEstimator相关的知识,希望对你有一定的参考价值。
RamUsageEstimator
新版本统计还不正确,很神秘,特别是对多维数组统计大小不对。
implementation group: 'com.carrotsearch', name: 'java-sizeof', version: '0.0.5';
int[][] array = new int[1024][1024];
System.out.println(RamUsageEstimator.humanReadableUnits(RamUsageEstimator.sizeOf(array)));
以上是关于统计JAVA对象大小的利器RamUsageEstimator的主要内容,如果未能解决你的问题,请参考以下文章