A profiling tool for exploiting the use of packed objects in java programs

Thumbnail Image



Journal Title

Journal ISSN

Volume Title


University of New Brunswick


Packed objects is an experimental feature in the IBM Jg Virtual Machine. Packed objects can be used to gain greater control over the layout of objects in memory. Applications which use packed objects have greater flexibility when they work with memory structures that are not in Java code. The purpose of developing this profiling tool is to assist software developers in determining how much performance and/ or memory gain they can achieve if they switch to packed objects from standard Java objects. This switch can result in reduced memory consumption by the application since the use of packed objects in Java applications can reduce the amount of memory required to store objects and it also increases the efficiency of caching. If the application is accessing a lot of native data using JNI method calls, then use of the packed objects will eliminate marshaling/unmarshaling of native data into Java objects and thus eliminating redundant data copying, which is a chief limitation of existing methods used to access native data in Java applications such as the JNI API, and the Java New I/0 APL The correctness and usefulness of the profiling tool is evaluated by running several test programs and benchmarks. Based on the results generated by the profiling tool for the benchmarks, the programs were modified to use packed objects instead of standard Java objects, and a performance gain was noticed in terms of reduced memory consumption by the program that allocates large array objects of non-primitive data types and by the program that uses the JNI functions to access arrays of primitive data types from the native side.