標題: 兩階段式線上記憶體洩漏偵測
Two-Phase Online Memory Leak Detection
作者: 梁睿珊
Liang, Jui-Shan
林一平
蔡孟勳
Lin, Yi-Bing
Tsai, Meng-Hsun
網路工程研究所
關鍵字: 記憶體洩漏;線上偵測;離線分析;記憶體堆疊;memory leak;online monitoring;offline analysis;heap;Java
公開日期: 2011
摘要: 程式執行過程中若有記憶體洩漏之現象發生,會導致記憶體資源的浪費,降低系統運行的效能,甚至導致整個系統當機。記憶體洩漏的問題往往不易在開發階段立即發現並修復,因此需要線上記憶體洩漏偵測之技術。 本論文提出以兩階段的方式線上偵測Java程式之記憶體洩漏。在第一階段(離線分析),使用者執行所要監控之程式一段時間,並使用我們所提出之代理程式分析其記憶體堆疊(heap)。代理程式接著離線計算記憶體堆疊中各資料結構的總佔用位元數(total occupied bytes),以便使用者依據此計算結果選擇可能造成記憶體洩漏之物件類別。在第二階段(線上監看),為了減少程式運行時額外增加的時間與空間,代理程式僅監看使用者所選擇的類別之物件,而非監看記憶體堆疊中的所有物件。本方法會回報被監看物件最後被存取之時間與位置(包含原始碼檔名以及行號),以利使用者參考並修改程式。
Memory leaks generated by a running program may exhaust memory resources and degrade system performance. In worst case memory leaks eventually crash the whole system. They threaten long-running systems such as customer service systems in telecom operations. It is hard to reproduce these kinds of leaks, let alone to identify and fix them early in the development phase. Thus online memory leak detection is required. In this paper we propose a two-phase approach to the online memory leak detection problem for Java programs. In phase one (offline analysis), the user executes the investigated program for a while and analyzes its heap with the proposed agent. The agent then summarizes the total occupied bytes of data structures in the heap offline, and the user is then able to select classes whose object instances seem to be potential leaks by examining the total occupied bytes summary. In phase two (online monitoring), to reduce the space and time overhead at runtime, the agent monitors online the objects of selected classes instead of monitoring all objects in the heap. The approach reports the last accessed time and location (including the source file name and the line number) of each leak candidate, with which the user can identify and fix leaks in the program.
URI: http://140.113.39.130/cdrfb3/record/nctu/#GT079956502
http://hdl.handle.net/11536/50541
Appears in Collections:Thesis


Files in This Item:

  1. 650201.pdf

If it is a zip file, please download the file and unzip it, then open index.html in a browser to view the full text content.