没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > javabi-sizeof |
javabi-sizeof
|
0 | 0 | 15 |
贡献者 | 讨论 | 代码提交 |
A small high performance utility for measuring object memory usage in Java.
long bytes = MemoryUtil.sizeOf( object );This utility is not meant to replace the excellent range of profiling tools available for Java such as VisualVM, YourKit or JProfiler, it is aimed for runtime debug/logging of selected structures in a production system.
Tutorial Calculations Common primitive and object sizes:
boolean 1 byte byte 1 byte short 2 bytes integer 4 bytes long 8 bytes float 4 bytes double 8 bytes
Boolean 16 bytes Byte 16 bytes Short 16 bytes Integer 16 bytes Long 16 bytes Float 16 bytes Double 16 bytes Currency 16 bytes Date 24 bytes
BigInteger ~56 bytes BigDecimal ~144 bytes GregorianCalendar ~460 bytes