The original solution we discovered from the application used XMLBeans to store quite a simplistic data structure. The overhead posed by the model ballooned the size of the 1.3 million instance structure to a way-too-large 1.5GB. After going through several optimization phases, such as converting first to Java Collections, then to Trove Collections, cleaning the redundant data and switching to compressed ordinary object pointers we were able to squeeze the same data into 73MB.
- Do not let integration details cross system boundaries
- Redundant data will be costly. Remove the redundancy whenever you can.
- Primitives are your friends. Know thy tools and learn Trove if you already haven’t
- Be aware of the optimization techniques provided by your JVM
Read more at: http://plumbr.eu/blog/reducing-memory-consumption-by-20x