[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article

Tolerating memory leaks

Published: 19 October 2008 Publication History

Abstract

Type safety and garbage collection in managed languages eliminate memory errors such as dangling pointers, double frees, and leaks of unreachable objects. Unfortunately, a program still leaks memory if it maintains references to objects it will never use again. Leaked objects decrease program locality and increase garbage collection frequency and workload. A growing leak will eventually exhaust memory and crash the program.
This paper introduces a leak tolerance approach called Melt that safely eliminates performance degradations and crashes due to leaks of dead but reachable objects in managed languages, given sufficient disk space to hold leaking objects. Melt (1) identifies stale objects that the program is not accessing; (2) segregates in-use and stale objects by storing stale objects to disk; and (3) preserves safety by activating stale objects if the program subsequently accesses them. We design and build a prototype implementation of Melt in a Java VM and show it adds overhead low enough for production systems. Whereas existing VMs grind to a halt and then crash on programs with leaks, Melt keeps many of these programs running much longer without significantly degrading performance. Melt provides users the illusion of a fixed leak and gives developers more time to fix leaky programs.

References

[1]
B. Alpern, C. R. Attanasio, J. J. Barton, M. G. Burke, P. Cheng, J.-D. Choi, A. Cocchi, S. J. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, M. Mergen, T. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. Shepherd, S. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeño Virtual Machine. IBM Systems Journal, 39(1):211--238, 2000.
[2]
M. Arnold, S. J. Fink, D. Grove, M. Hind, and P. F. Sweeney. Adaptive Optimization in the Jalapeño JVM. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 47--65, 2000.
[3]
M. P. Atkinson, L. Daynès, M. J. Jordan, T. Printezis, and S. Spence. An Orthogonally Persistent Java. SIGMOD Rec., 25(4):68--75, 1996.
[4]
D. Bacon, P. Cheng, and V. Rajan. A Real-Time Garbage Collector with Low Overhead and Consistent Utilization. In ACM Symposium on Principles of Programming Languages, pages 285--298, 2003.
[5]
E. D. Berger and B. G. Zorn. DieHard: Probabilistic Memory Safety for Unsafe Languages. In ACM Conference on Programming Language Design and Implementation, pages 158--168, 2006.
[6]
S. M. Blackburn, P. Cheng, and K. S. McKinley. Oil and Water? High Performance Garbage Collection in Java with MMTk. In ACM International Conference on Software Engineering, pages 137--146, 2004.
[7]
S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer,M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanovićc, T. VanDrunen, D. von Dincklage, and B. Wiedermann. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 169--190, 2006.
[8]
S. M. Blackburn and A. L. Hosking. Barriers: Friend or Foe? In ACM International Symposium on Memory Management, pages 143--151, 2004.
[9]
M. D. Bond and K. S. McKinley. Bell: Bit-Encoding Online Memory Leak Detection. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems, pages 61--72, 2006.
[10]
M. D. Bond and K. S. McKinley. Tolerating Memory Leaks. Technical Report TR-07-64, University of Texas at Austin, December 2007.
[11]
D. Breitgand, M. Goldstein, E. Henis, O. Shehory, and Y. Weinsberg. PANACEA-Towards a Self-Healing Development Framework. In Integrated Network Management, pages 169--178, 2007.
[12]
G. Chen, M. Kandemir, N. Vijaykrishnan, M. J. Irwin, B. Mathiske, and M. Wolczko. Heap Compression for Memory-Constrained Java Environments. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 282--301, 2003.
[13]
W. Chen, S. Bhansali, T. Chilimbi, X. Gao, and W. Chuang. Profile-guided Proactive Garbage Collection for Locality Optimization. In ACM Conference on Programming Language Design and Implementation, pages 332--340, 2006.
[14]
S. Cherem, L. Princehouse, and R. Rugina. Practical Memory Leak Detection using Guarded Value-Flow Analysis. In ACM Conference on Programming Language Design and Implementation, pages 480--491, 2007.
[15]
T. M. Chilimbi and M. Hauswirth. Low-Overhead Memory Leak Detection Using Adaptive Statistical Profiling. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems, pages 156--164, 2004.
[16]
DaCapo Benchmark Regression Tests. http://jikesrvm.anu.-edu.au/?dacapo/.
[17]
E. W. Dijkstra, L. Lamport, A. J. Martin, C. S. Scholten, and E. F. M. Steffens. On-the-Fly Garbage Collection: An Exercise in Cooperation. Commun. ACM, 21(11):966--975, Nov. 1978.
[18]
Eclipse.org Home. http://www.eclipse.org/.
[19]
B. Goetz. Plugging memory leaks with weak references, 2005. http://www-128.ibm.com/developerworks/java/-library/j-jtp11225/.
[20]
B. Goetz. Plugging memory leaks with soft references, 2006. http://www-128.ibm.com/developerworks/java/-library/j-jtp01246.html.
[21]
M. Goldstein, O. Shehory, and Y. Weinsberg. Can Self-Healing Software Cope With Loitering? In International Workshop on Software Quality Assurance, pages 1--8, 2007.
[22]
L. J. Guibas, D. E. Knuth, and M. Sharir. Randomized Incremental Construction of Delaunay and Voronoi Diagrams. In Colloquium on Automata, Languages and Programming, pages 414--431, 1990.
[23]
S. C. Gupta and R. Palanki. Java memory leaks -- Catch me if you can, 2005. http://www.ibm.com/developerworks/-rational/library/05/0816 GuptaPalanki/index.html.
[24]
R. Hastings and B. Joyce. Purify: Fast Detection of Memory Leaks and Access Errors. In Winter USENIX Conference, pages 125--136, 1992.
[25]
D. L. Heine and M. S. Lam. A Practical Flow-Sensitive and Context-Sensitive C and C++ Memory Leak Detector. In ACM Conference on Programming Language Design and Implementation, pages 168--181, 2003.
[26]
M. Hertz, Y. Feng, and E. D. Berger. Garbage Collection without Paging. In ACM Conference on Programming Language Design and Implementation, pages 143--153, 2005.
[27]
M. Hirzel, A. Diwan, and J. Henkel. On the Usefulness of Type and Liveness Accuracy for Garbage Collection and Leak Detection. ACM Transactions on Programming Languages and Systems, 24(6):593--624, 2002.
[28]
A. L. Hosking and J. Chen. PM3: An Orthogonal Persistent Systems Programming Language -- Design, Implementation, Performance. In International Conference on Very Large Data Bases, pages 587--598, 1999.
[29]
A. L. Hosking and J. E. B. Moss. Object Fault Handling for Persistent Programming Languages: A Performance Evaluation. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 288--303, 1993.
[30]
A. L. Hosking, N. Nystrom, Q. I. Cutts, and K. Brahnmath. Optimizing the Read and Write Barriers for Orthogonal Persistence. In International Workshop on Persistent Object Systems, pages 149--159, 1999.
[31]
X. Huang, S. M. Blackburn, K. S. McKinley, J. E. B. Moss, Z. Wang, and P. Cheng. The Garbage Collection Advantage: Improving Program Locality. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 69--80, 2004.
[32]
Jikes RVM. http://www.jikesrvm.org.
[33]
Jikes RVM Research Archive. http://www.jikesrvm.org/-Research+Archive.
[34]
M. Jump and K. S. McKinley. Cork: Dynamic Memory Leak Detection for Garbage-Collected Languages. In ACM Symposium on Principles of Programming Languages, pages 31--38, 2007.
[35]
J.Maebe, M. Ronsse, and K. D. Bosschere. Precise Detection of Memory Leaks. In International Workshop on Dynamic Analysis, pages 25--31, 2004.
[36]
A. Marquez, S. M. Blackburn, G. Mercer, and J. Zigman. Implementing Orthogonally Persistent Java. In International Workshop on Persistent Object Systems, pages 247--261, 2000.
[37]
Mckoi SQL Database message board: memory/thread leak with Mckoi 0.93 in embedded mode, 2002. http://www.-mckoi.com/database/mail/subject.jsp?id=2172.
[38]
N. Mitchell and G. Sevitsky. LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications. In European Conference on Object-Oriented Programming, pages 351--377, 2003.
[39]
J. E. B. Moss. Working with Persistent Objects: To Swizzle or Not to Swizzle. IEEE Transactions on Computers, 18(8):657--673, 1992.
[40]
N. Nethercote and J. Seward. Valgrind: A Framework for Heavyweight Dynamic Binary Instrumentation. In ACM Conference on Programming Language Design and Implementation, pages 89--100, 2007.
[41]
H. H. Nguyen and M. Rinard. Detecting and Eliminating Memory Leaks Using Cyclic Memory Allocation. In ACM International Symposium on Memory Management, pages 15--29, 2007.
[42]
G. Novark, E. D. Berger, and B. G. Zorn. Plug: Automatically Tolerating Memory Leaks in C and C++ Applications. Technical Report UM-CS-2008-009, University of Massachusetts, 2008.
[43]
K. Ogata, T. Onodera, K. Kawachiya, H. Komatsu, and T. Nakatani. Replay Compilation: Improving Debuggability of a Just-in-Time Compiler. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 241--252, 2006.
[44]
Oracle. JRockit Mission Control. http://www.oracle.com/-technology/products/jrockit/missioncontrol/.
[45]
F. Pizlo, D. Frampton, E. Petrank, and B. Steensgaard. Stopless: A Real-Time Garbage Collector for Multiprocessors. In ACM International Symposium on Memory Management, pages 159--172, 2007.
[46]
D. Plainfossé. Distributed Garbage Collection and Reference Management in the Soul Object Support System. PhD thesis, Université Paris-6, Pierre-et-Marie-Curie, 1994.
[47]
F. Qin, S. Lu, and Y. Zhou. SafeMem: Exploiting ECCMemory for Detecting Memory Leaks and Memory Corruption During Production Runs. In International Symposium on High-Performance Computer Architecture, pages 291--302, 2005.
[48]
F. Qin, J. Tucek, J. Sundaresan, and Y. Zhou. Rx: Treating Bugs as Allergies-A Safe Method to Survive Software Failures. In ACM Symposium on Operating Systems Principles, pages 235--248, 2005.
[49]
Quest. JProbe Memory Debugger. http://www.quest.com/-jprobe/debugger.asp.
[50]
M. Rinard, C. Cadar, D. Dumitran, D. Roy, T. Leu, and W. Beebee. Enhancing Server Availability and Security through Failure-Oblivious Computing. In USENIX Symposium on Operating Systems Design and Implementation, pages 303--316, 2004.
[51]
N. Sachindran, J. E. B. Moss, and E. D. Berger. MC2: High-Performance Garbage Collection for Memory-Constrained Environments. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 81--98, 2004.
[52]
SciTech Software. .NET Memory Profiler. http://www.-scitech.se/memprofiler/.
[53]
Standard Performance Evaluation Corporation. SPECjvm98 Documentation, release 1.03 edition, 1999.
[54]
Standard Performance Evaluation Corporation. SPECjbb2000 Documentation, release 1.01 edition, 2001.
[55]
Sun Developer Network Forum. Java Programming {Archive} - garbage collection dilema (sic), 2003. http://forum.java.-sun.com/thread.jspa?threadID=446934.
[56]
Sun Developer Network Forum. Reflections & Reference Objects - Java memory leak example, 2003. http://forum.-java.sun.com/thread.jspa?threadID=456545.
[57]
Y. Tang, Q. Gao, and F. Qin. LeakSurvivor: Towards Safely Tolerating Memory Leaks for Garbage-Collected Languages. In USENIX Annual Technical Conference, pages 307--320, 2008.
[58]
P. R. Wilson. Pointer Swizzling at Page Fault Time: Efficiently Supporting Huge Address Spaces on Standard Hardware. ACM SIGARCH Comput. Archit. News, 19(4):6--13, 1991.
[59]
F. Xian,W. Srisa-an, and H. Jiang. MicroPhase: An Approach to Proactively Invoking Garbage Collection for Improved Performance. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 77--96, 2007.
[60]
T. Yang, E. D. Berger, S. F. Kaplan, and J. E. B. Moss. CRAMM: Virtual Memory Support for Garbage-Collected Applications. In USENIX Symposium on Operating Systems Design and Implementation, pages 103--116, 2006.
[61]
T. Yang, M. Hertz, E. D. Berger, S. F. Kaplan, and J. E. B. Moss. Automatic Heap Sizing: Taking Real Memory into Account. In ACM International Symposium on Memory Management, pages 61--72, 2004.
[62]
J. N. Zigman, S. Blackburn, and J. E. B. Moss. TMOS: A Transactional Garbage Collector. In International Workshop on Persistent Object Systems, pages 138--156, 2001.
[63]
B. Zorn. Barrier Methods for Garbage Collection. Technical Report CU-CS-494-90, University of Colorado at Boulder, 1990.

Cited By

View all
  • (2024)Asking and Answering Questions During Memory ProfilingIEEE Transactions on Software Engineering10.1109/TSE.2024.337712750:5(1096-1117)Online publication date: 13-Mar-2024
  • (2020)Improving program locality in the GC using hotnessProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3385977(301-313)Online publication date: 11-Jun-2020
  • (2020)ThinGC: complete isolation with marginal overheadProceedings of the 2020 ACM SIGPLAN International Symposium on Memory Management10.1145/3381898.3397213(74-86)Online publication date: 16-Jun-2020
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 43, Issue 10
September 2008
613 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1449955
Issue’s Table of Contents
  • cover image ACM Conferences
    OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications
    October 2008
    654 pages
    ISBN:9781605582153
    DOI:10.1145/1449764
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 October 2008
Published in SIGPLAN Volume 43, Issue 10

Check for updates

Author Tags

  1. bug tolerance
  2. managed languages
  3. memory leaks

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)25
  • Downloads (Last 6 weeks)7
Reflects downloads up to 11 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Asking and Answering Questions During Memory ProfilingIEEE Transactions on Software Engineering10.1109/TSE.2024.337712750:5(1096-1117)Online publication date: 13-Mar-2024
  • (2020)Improving program locality in the GC using hotnessProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3385977(301-313)Online publication date: 11-Jun-2020
  • (2020)ThinGC: complete isolation with marginal overheadProceedings of the 2020 ACM SIGPLAN International Symposium on Memory Management10.1145/3381898.3397213(74-86)Online publication date: 16-Jun-2020
  • (2020)Do Memories Haunt You? An Automated Black Box Testing Approach for Detecting Memory Leaks in Android AppsIEEE Access10.1109/ACCESS.2020.29665228(12217-12231)Online publication date: 2020
  • (2018)A low-overhead and efficient Java object profiler on ART virtual machineJournal of Intelligent & Fuzzy Systems: Applications in Engineering and Technology10.3233/JIFS-16965535:3(2997-3009)Online publication date: 1-Jan-2018
  • (2015)A Detection and Measurement Approach for Memory Leaked Objects in Java ProgramsIEICE Transactions on Information and Systems10.1587/transinf.2014EDP7320E98.D:5(1053-1061)Online publication date: 2015
  • (2015)A Predictive Control Approach for Fault Management of Computing SystemsACM SIGMETRICS Performance Evaluation Review10.1145/2847220.284722543:3(16-20)Online publication date: 19-Nov-2015
  • (2015)Towards Proactive Fault Management of Enterprise SystemsProceedings of the 2015 International Conference on Cloud and Autonomic Computing10.1109/ICCAC.2015.18(21-32)Online publication date: 21-Sep-2015
  • (2014)Source Code Annotated Memory Leak Detection for Soft Real Time Embedded Systems with Resource ConstraintsProceedings of the 2014 IEEE 12th International Conference on Dependable, Autonomic and Secure Computing10.1109/DASC.2014.38(166-172)Online publication date: 24-Aug-2014
  • (2013)ShadowDataProceedings of the 11th ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering10.1145/2462029.2462032(17-24)Online publication date: 20-Jun-2013
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media