1.maven 导入相关依赖

<!-- https://mvnrepository.com/artifact/com.carrotsearch/java-sizeof -->
<dependency>
    <groupId>com.carrotsearch</groupId>
    <artifactId>java-sizeof</artifactId>
    <version>0.0.5</version>
</dependency>

  

2.代码打印内存大小

log.info("RamUsageEstimator数据大小:{}", RamUsageEstimator.sizeOf(xxxxx));

  

 

相关文章:

  • 2021-07-28
  • 2021-12-06
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-10-24
  • 2021-09-05
相关资源
相似解决方案