標題: | 在Dalvik 虛擬機器上對動態編譯碼的檔案基礎式共享 File-Based Sharing For Dynamically Compiled Code On Dalvik Virtual Machine |
作者: | 黃曜志 Huang, Yao-Chih 楊武 Yang, Wuu 資訊科學與工程研究所 |
關鍵字: | Dalvik虛擬機器;Android;記憶體使用量;JNI;Trace-Based JIT Compiler;檔案基礎分享;程式碼分享;Dalvik Virtual Machine;Android;memory footprint;JNI;Trace-Based JIT Compiler;File-Basd Sharing;code sharing |
公開日期: | 2010 |
摘要: | 在嵌入式系統的環境中,記憶體的使用量被視為是一個重要的議題。共享不同虛擬機器之間的動態編譯碼,可以減少重複編譯所產生的記憶體使用量以及改善效能。另一方面,因為 Dalvik 虛擬機器提供了Java Native Interface(JNI),所以共享可寫入的原生碼可能會造成安全性的問題。為此,我們提出一個對於 Dalvik 虛擬機器在 Android 平台上可以確保安全性的原生碼共享機制。動態產生的原生碼會被存在檔案中,當其他的虛擬機器需要相同的原生碼時,可以透過記憶體映射的方式來分享原生碼。並且藉由控制檔案權限,來確保安全性。為了改善安全性,我們實作了一個取名為Query agent的daemon process,用來控制所有原生碼的存取及保存所有原生碼相關的資訊。我們實作原生碼的共享機制在Android 2.1的版本上,並且在arm基礎的系統上做實驗。我們獲得了45% 程式碼快取大小的縮減,並且藉由消除重複編譯的負擔來取得9%的效能改善。 Memory footprint is considered as an important design issue for embedded systems. Sharing dynamically compiled code among virtual machines can reduce memory footprint and recompilation overhead. On the other hand, sharing writable native code may cause security problems, due to support of Native function call such as JNI. We propose a native-code sharing mechanism that ensures the security for Dalvik virtual machine on the Android platform. Dynamically generated code is saved in a file and is shared with memory mapping when other VMs need the same code. Protection is granted by file-access permissions. To improve the security, we implement a daemon process, named Query Agent, to control all accesses to the native code and maintain all the information of traces, which are the units of the compilation in the Dalvik VM. We implement our code sharing mechanism on Android version 2.1 system, and experiment on an arm-based system. We get 45% code-cache size reduction and 9% performance improvement from eliminating recompilation overhead. |
URI: | http://140.113.39.130/cdrfb3/record/nctu/#GT079755579 http://hdl.handle.net/11536/45923 |
顯示於類別: | 畢業論文 |