During the development of performance-sensitive Java software it is important to know how much memory space will each realization alternative need for running, since it has a huge influence on both the maximum size of manageable data and the execution speed of the program itself. The open source model query framework VIATRA Query, partly developed at the Department of Measurement and Information Systems, has a performance testing harness that is able to determine a query’s memory footprint by automatically measuring the difference between two states of heap memory, thus allowing us to compare different ways of specifying or evaluating a query.
There are various solutions for automated memory measurement of Java programs, but due to the characteristics of heap management in the Java Virtual Machine, the tools easily available for microbenchmarking cannot provide accurate values. In complex software, if one component’s memory footprint is determined as the difference in total memory consumption between two states of the program, the inaccuracy of measurement data makes it extremely difficult to draw a conclusion. Therefore, my task is to develop a memory-measuring software module for microbenchmarking, which determines the size of the currently used “live heap” memory with great accuracy.
During my work I got familiar with the memory measuring techniques on Java virtual engines and investigated which one would be able to give the most precise measurements. I chose one measuring technology and have verified its accuracy on my own test application. Then, I managed to implement a reusable tool for the automated memory measuring.
At the end, I integrated the solution into the VIATRA Query performance analyzer. Finally, I compared the results with the previously used approach and evaluated the improvement in measurement accuracy.