Font Size: a A A

Garbage Collection Algorithm Analysis And Performance Optimization In The Dalvik Virtual Machine

Posted on:2016-11-03Degree:MasterType:Thesis
Country:ChinaCandidate:D D XiaFull Text:PDF
GTID:2271330503977208Subject:IC Engineering
Abstract/Summary:PDF Full Text Request
The Dalvik virtual machine is the core module of Android system. The speed of its Java program execution directly affects the performance of the system. Java language uses automatic garbage collection mechanism to manage heap, which reduces the workload of programmers and to a great extent avoids memory leak. However, this mechanism also brings performance slowing down, response delay and other problems. This thesis analyzes the details of the original garbage collection algorithm in Android and optimizes the performance of the GC.This thesis find out the performance bottleneck by analyzing the original garbage collection algorithm in the Dalvik virtual machine. Firstly, an Incremental Mark Algorithm is designed and implemented to avoid long suspending time in the Concurrent GC’s initial mark phase. Marking the root set is divided into two phases, and each time the scheme only marks a part of root set. Then it concurrently marks the references of this root set; Secondly, due to the locality of object’s survival time and space, a generational garbage collection algorithm by age is presented. An age bitmap is added in the heap source to count objects’ age, when an object’s age reaches the old age threshold, it will be promoted to the old age group. In order to avoid frequent operations on large objects, this thesis put them into old age group directly. A full garbage collection only is invoked when the collection of young generation can’t meet the applicaton’s demand. By this strategy, garbage collection will focus on the young generation and it will reduce the system’s suspending time.This thesis uses Oxbenchmark running on the Nexus3 platform as the testbench for the introduced algorithm in this thesis. The test result shows:without sacrificing GC performance, the Incremental Mark Algorithm has no long time’s suspending problems and the count of long pause time is reduced from 12 times to 0 times. In the Oxbenchmark for overall system performance test, the generational garbage collection algorithm’s fastest time is 4093ms which has a 36.97% upgrade, and the average time is 4497.85ms, which has a 35.25% upgrade. In the test of allocation and free trees of different depths, the generational garbage collection algorithm has a 36% upgrade on the garbage collection performance scores.
Keywords/Search Tags:Android, Dalvik virtual machine, Garbage Collection algorithm, Incremental Mark, Generational garbage collection
PDF Full Text Request
Related items