Abstract
Android systems typically run on resource-constrained hand-hold devices. How to efficiently utilize Java heaps is one of the most important issues of concerns to the developers. Developers often use profilers to observe the utilization efficiency of Java objects, hoping to find out memory allocation bottlenecks, identify and solve problems such as memory leaks, etc. However, currently there lacks a low-overhead and efficient Java object profiler on Android and its Java virtual machines.
In this paper, we design and implement a novel and low-overhead Java object profiler based on the Address-Chain technique, on Android 6.0 and its ART virtual machine, which uses an AOT (ahead-of-time) compiler and has complex garbage collection algorithms. Our profiler records the allocation site, the class information of the object, the object size, the birth time and death time of the object, the physical memory trace of the object movements with time stamps, the last access time and the access regular pattern, etc., for every Java object. The data profiled can help the developers to detect memory leaks, implement optimizations like pretenuring and tune the performance of garbage collector, etc.
The Java object profiling mechanism proposed in this paper has low execution time overhead, imposes no overhead on the Java heap and does not modify any existing key data structure of the ART Virtual Machine, including the object layouts, class layouts and any others. By caching object access event in global register and removing redundant instrumentation, on Nexus7 and Android 6.0, the read/write barriers overheads of the profiler are about 19% on average for EEMBC, SciMark and other workloads. The I/O overheads are about 28% and the total execution overheads are about 51% on average.
Get full access to this article
View all access options for this article.
