Java memory benchmark -
i'm developing own pet project in java consist of custom data structures. measure performance chose google caliper framework, measure memory usage of data structure should each time measure using visuamvm (dump heap , wait calculation of object retained size), valid results. want make kind of "memory benchmark" tests.
so, question is:
is there java framework similar caliper or junitbenchmarks allows make tests measure memory consumption of data structures?
this tool appropriate you. open jdk - java object layout
$ java -jar jol-cli/target/jol-internals.jar java.util.hashmap running 64-bit hotspot vm. using compressed references 3-bit shift. objects 8 bytes aligned. field sizes type: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes] array element sizes: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes] java.util.hashmap object internals: offset size type description value 0 4 (object header) 01 00 00 00 (00000001 00000000 00000000 00000000) 4 4 (object header) 00 00 00 00 (00000000 00000000 00000000 00000000) 8 4 (object header) 0f 0f 3e e0 (00001111 00001111 00111110 11100000) 12 4 set abstractmap.keyset null 16 4 collection abstractmap.values null 20 4 int hashmap.size 0 24 4 int hashmap.threshold 16 28 4 float hashmap.loadfactor 0.75 32 4 int hashmap.modcount 0 36 4 int hashmap.hashseed 0 40 4 entry[] hashmap.table [] 44 4 set hashmap.entryset null instance size: 48 bytes (estimated, add jar via -javaagent: accurate result) space losses: 0 bytes internal + 0 bytes external = 0 bytes total
Comments
Post a Comment