参考文档:
Java问题诊断和排查工具(查看JVM参数、内存使用情况及分析) | 二哥的Java进阶之路
https://www.cnblogs.com/vickwv/p/14978283.html
引用第三方类库
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
- <version>4.0.0</version>
- </dependency>
System.out.println("orcSaveDto:" + orcSaveDto); System.out.println("orcSaveDto size is " + RamUsageEstimator.shallowSizeOf(orcSaveDto)); System.out.println("orcSaveDto size is 1: " + RamUsageEstimator.humanReadableUnits(RamUsageEstimator.sizeOfObject(orcSaveDto))); System.out.println("orcSaveDto size is 2: " + RamUsageEstimator.sizeOfObject(orcSaveDto));