Responsive image
博碩士論文 etd-0723107-154522 詳細資訊
Title page for etd-0723107-154522
論文名稱
Title
利用時間序列分析偵測Java 記憶體洩漏
Detecting Java Memory Leak by Time Series Analysis
系所名稱
Department
畢業學年期
Year, semester
語文別
Language
學位類別
Degree
頁數
Number of pages
67
研究生
Author
指導教授
Advisor
召集委員
Convenor
口試委員
Advisory Committee
口試日期
Date of Exam
2007-06-25
繳交日期
Date of Submission
2007-07-23
關鍵字
Keywords
資源測試、時間序列分析、垃圾收集機制、記憶體洩漏
Resource Testing, Memory Leak, Time Series Analysis, Garbage Collection
統計
Statistics
本論文已被瀏覽 5904 次,被下載 8
The thesis/dissertation has been browsed 5904 times, has been downloaded 8 times.
中文摘要
記憶體洩漏是一種常見會造成系統效能衰退或是使系統當掉的程式漏洞。記憶體洩漏也是導致軟體老化常見的原因。在C/C++的程式語言中,由於程式設計師必須手動管理記憶體的使用情況,因此常會造成記憶體資源使用上的問題。然而,許多人會認為Java 有提供自動化垃圾回收(Automatic Garbage Collection)的機制,使用者不需要花費更多的時間去管理記憶體的使用情況,因此就不會產生記憶體洩漏的情況。但是事實並非如此,在Java 中確實還是會有產生記憶體洩漏的情況。其產生記憶體洩漏的原因主要是記憶體物件仍有指標參考到,因此這個物件無法回收,但是這個物件卻在之後都不會用到,也就是此物件既無用又無法回收。

本研究的目的主要是透過物件的成長趨勢來找出疑似在記憶體使用上有問題的物件。首先,本研究先監控每次full gc 後堆(heap)中的記憶體物件的成長情況並將疑似在記憶體管理上有問題的程式找出來。接下來針對這些有問題的程式,每隔固定時間便觀察且紀錄堆(heap)中每個物件的成長趨勢。然後透過時間序列分析偵測出在記憶體使用上有問題的物件。將本研究所出的方法運用在四支有記憶體洩漏的四支Java 程式上,確實能夠將洩漏物件過濾出來。
Abstract
A memory leak is a common software vulnerability that will lead to performance degradation of the software or crash or both. A Memory leak is one typical cause of software aging. The phenomenon of memory leaks usually occurs in C/C++ because programmers need to manage memory by themselves when programs run. However, many think that Java does not suffer from memory leaks since Java provides automatic garbage collection. Actually, Java programs will run out of memory unexpectedly after executing for a long time. The reason for Java memory leaks is that reachable objects are no longer needed. These objects should be reclaimed but they can’t because they are still referenced.

This thesis introduces a method for filtering the leaked objects in Java memory leak programs. First, we monitor the heap growth after each full garbage collection and the
numbers of full garbage collection to identify programs that might have potential memory management problems. Second, we periodically keep track of growth trend of each object of problematic programs and filter out the suspected one by time series analysis. Finally, we execute the program blocks that include objects that we find out to see if the program will run out of memory eventually. The method has been implemented and has been verified successful by four Java memory leak programs.
目次 Table of Contents
1. 序論...................................................................................................................................1
1.1 背景說明....................................................................................................................1
1.2 研究動機....................................................................................................................2
2. 文獻探討...........................................................................................................................4
2.1 軟體測試....................................................................................................................4
2.2 軟體老化....................................................................................................................7
2.3 記憶體相關問題........................................................................................................8
2.4 垃圾收集機制..........................................................................................................10
2.5 時間序列分析..........................................................................................................13
3. 問題描述.........................................................................................................................21
3.1 C/C++中的記憶體洩漏情況....................................................................................21
3.2 Java 中的記憶體洩漏情況.....................................................................................23
3.3 多餘的參考..............................................................................................................26
4. 利用時間序列分析偵測Java 中記憶體洩漏的情況...................................................29
4.1 先前的方法..............................................................................................................29
4.2 透過時間序列分析找出洩漏物件..........................................................................31
5. 實驗結果與討論.............................................................................................................39
5.1 方法論......................................................................................................................39
5.2 受測程式..................................................................................................................44
5.3 實驗結果..................................................................................................................46
5.4 物件使用量趨勢分析 V.S. 自動化資源測試........................................................54
6. 結論與未來研究方向.....................................................................................................57
參考文獻................................................................................................................................58
參考文獻 References
1. Huang, Y., et al., Software Rejuvenation: Analysis, Module and Applications, in
Proceedings of the Twenty-Fifth International Symposium on Fault-Tolerant
Computing. 1995. p. 381–390.
2. Berndt, D.J. and A. Watkins, High Volume Software Testing using Genetic Algorithms.
2005, IEEE Computer Society Washington, DC, USA.
3. Hastings, R. and B. Joyce. Purify: Fast detection of memory leaks and access errors.
in Winter USENIX Conference. 1992.
4. Luecke, G.R., et al., A Survey of Systems for Detecting Serial Run-Time Errors.
Concurrency and Computation: Practice & Experience, 2006. 18(15): p. 1885-1907.
5. SGI. memory leak. [cited; Available from:
http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=bks&srch=&fna
me=/SGI_Developer/ProDev_Perf/sgi_html/go01.html.
6. Hetzel, B., The complete guide to software testing. 1988: QED Information Sciences,
Inc. Wellesley, MA, USA.
7. Beizer, B., Software testing techniques. 1990: Van Nostrand Reinhold Co. New York,
NY, USA.
8. Huang, Y.W., et al., Securing Web Application Code by Static Analysis and Runtime
Protection, in International World Wide Web Conference. 2004. p. 40-52.
9. Moore, D., et al., Inferring Internet denial-of-service activity. ACM Transactions on
Computer Systems 2006. 24(2): p. 115-139.
10. Hoglund, G. and G. McGraw, Exploiting Software: How to Break Code. 2004: Pearson
Higher Education.
11. 劉威成, Appling resource usage analysis to software testing. 2007, National Sun
Yat-sen University.
12. Li, L., et al., Analysis of Software Aging in a Web Server. IEEE Transaction on
reliability, 2006. 55: p. 411-421.
13. Garg, S., et al. A Methodology for Detection and Estimation of Software Aging. in
Proceedings of the 9th International Symposium on Software. 1998.
14. Parnas, D.L. Software aging. in Proceedings of the 16th international conference on
Software engineering. 1994: IEEE Computer Society Press Los Alamitos, CA, USA.
15. Trivedi, K. and K. Vaidyanathan, A measurement-based model for estimation of
resource exhaustion in operational software systems, in Proceedings of the 10th
International Symposium on Software Reliability Engineering. 1999. p. 84–93.
16. Thakur, A. and R.K. Iyer, Analyze-NOW-an environment for collection and analysis of
failuresin a network of workstations. IEEE Transactions on Reliability, 1996. 45(4): p.
561-570.
59
17. Tikir, M.M. and J.K. Hollingsworth, Efficient instrumentation for code coverage
testing, in Proceedings of the 2002 ACM SIGSOFT international symposium on
Software testing and analysis. 2002, ACM Press New York, NY, USA. p. 86-96.
18. Gallagher, M.J. and V. Lakshmi Narasimhan, ADTEST: a test data generation suite
for Ada software systems. IEEE Transactions on Software Engineering, 1997. 23(8): p.
473-484.
19. Michalewicz, Z., Genetic Algorithms+ Data Structures= Evolution Programs. 1996:
Springer.
20. McGee, P. and C. Kaner, Experiments with High Volume Test Automation, in ACM
SIGSOFT Software Engineering Notes. September 2004. p. 1-3.
21. Holland, J.H., Adaptation in natural and artificial systems. 1992: MIT Press
Cambridge, MA, USA.
22. Kumar, A.N., Learning the interaction between pointers and scope in C++. 2001,
ACM Press New York, NY, USA. p. 45-48.
23. Preiss, B.R. and M.A.S. B.A.Sc., Ph.D., P.Eng., Data Structures and Algorithms with
Object-Oriented Design Patterns in Java. 1999.
24. Wikipedia. Garbage collection(computer science). 2007 [cited; Available from:
http://en.wikipedia.org/wiki/Garbage_collection_(computer_science).
25. B.Venners. An introduction to the garbage-collected. 1996 [cited; Available from:
http://www.javaworld.com/javaworld/jw-08-1996/jw-08-gc.html.
26. Haines, S. Solving common Java EE performance problems. 2006 [cited;
Available from:
http://www.javaworld.com/javaworld/jw-06-2006/jw-0619-tuning.html.
27. Brockwell, P.J. and R.A. Davis, Introduction to time series and forecasting. 2002,
Springer New York.
28. Krajewski, Ritzman, and Malhotra, Operations management 8e. 2005.
29. Collections-framework. [cited; Available from:
java.sun.com/j2se/1.4.1/docs/guide/collection.
30. Bush, W.R., J.D. Pincus, and D.J. Sielaff, A static analyzer for finding dynamic
programming errors. Software: Practice and Experience, 2000. 30(7): p. 775-802.
31. Engler, D., et al. Bugs as Deviant Behavior: A General Approach to Inferring Errors
in Systems Code. in Proceedings of the eighteenth ACM symposium on Operating
systems principles. 2001. Banff, Alberta, Canada: ACM Press New York, NY,
USA.
32. Hallem, S., et al. A system and language for building system-specific, static analyses.
in ACM SIGPLAN Conference on
Programming Language Design and Implementation,. 2002: ACM Press New York,
NY, USA.
60
33. Heine, D.L. and M.S. Lam. A practical flow-sensitive and context-sensitive C and
C++ memory leak detector. in Programming language design and implementation.
2003. San Diego, California, USA: ACM Press New York, NY, USA.
34. Heine, D.L., STATIC MEMORY LEAK DETECTION. 2004, STANFORD
UNIVERSITY.
35. Dor, N., M. Rodeh, and M. Sagiv. CSSV: towards a realistic tool for statically
detecting all buffer overflows in C. in ACM SIGPLAN conference on Programming
language design and implementation. 2003: ACM Press New York, NY, USA.
36. Parasoft. Insure++. [cited; Available from:
http://www.parasoft.com/produts/insure.
37. Chilimbi, T.M. and M. Hauswirth, Low-overhead memory leak detection using
adaptive statistical profiling. 2004, ACM. p. 156-164.
38. Gupta, S.C. and R. Palanki. Java memory leaks. 2005 [cited; Available from:
http://www-128.ibm.com/developerworks/rational/library/05/0816_GuptaPalanki/.
39. koders. The leading search engine for open source code. [cited; Available from:
http://www.koders.com/.
40. Hunter, J.M. ArrayListExample. [cited; Available from:
http://www.idevelopment.info/data/Programming/java/.
41. 陳柏凱, An Automated Method for Resource Testing. 2006, National Sun Yat-sen
University.
電子全文 Fulltext
本電子全文僅授權使用者為學術研究之目的,進行個人非營利性質之檢索、閱讀、列印。請遵守中華民國著作權法之相關規定,切勿任意重製、散佈、改作、轉貼、播送,以免觸法。
論文使用權限 Thesis access permission:校內一年後公開,校外永不公開 campus withheld
開放時間 Available:
校內 Campus: 已公開 available
校外 Off-campus:永不公開 not available

您的 IP(校外) 位址是 3.19.30.232
論文開放下載的時間是 校外不公開

Your IP address is 3.19.30.232
This thesis will be available to you on Indicate off-campus access is not available.

紙本論文 Printed copies
紙本論文的公開資訊在102學年度以後相對較為完整。如果需要查詢101學年度以前的紙本論文公開資訊,請聯繫圖資處紙本論文服務櫃台。如有不便之處敬請見諒。
開放時間 available 已公開 available

QR Code