Friday 2nd November, 2012
3:00pm to 3:45pm
Java collections framework is probably the most frequently used Java API. Rarely an algorithm is implemented without using some class from it. But do you know how much memory that 3-element set uses? You have no idea... In this talk we will describe hands-on how memory (in)efficient Java Collection classes are and discuss alternatives to using them.
We will begin by discussing some ways of measuring the memory consumption of different objects and object graphs in Java applications. Next, these techniques will be used to measure how much memory simple objects actually take. While at it, we will explain and discuss object references, memory alignments, integer cache and flyweight objects.
After the discussion of simple objects we will then demonstrate how much memory is really needed in order to accommodate a given amount of data into different structures from Java Collection API.
In the end of the talk we briefly discuss some alternatives to Java Collections, such as Google Guava and Trove and their memory footprint in comparison to standard libraries.
Sign in to add slides, notes or videos to this session