SizeOf in Java: Because Size Does Matter!

SizeOf in Java: Because Size Does Matter!

RAM prices have plummeted and servers with tens or even hundreds of Gigabytes of memory have become common these days. What this means to your application’s architecture and deployment topology is important. On heap caching of data within enterprise application is a common example.

Yet how do you make the best use of all that memory ? Since version 2.5, Ehcache comes with the ability to size your caches in bytes rather that in entry counts. Nothing really fancy, if it wasn’t for Java’s lack of sizeOf function. This presentation will take you, with code, through the journey of implementing the sizeOf library for the Java platform; across multiple versions, vendors and all their permutations (including 32 vs. 64 bit platforms, CMS, Compressed OOPS, …). The library also led us to offer new & much more dynamic ways of making use of that memory for on-heap caches within your application…

Video Producer: http://javazone.no/