skip to main content
10.1145/1449764.1449774acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Tolerating memory leaks

Published:19 October 2008Publication 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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. M. Blackburn and A. L. Hosking. Barriers: Friend or Foe? In ACM International Symposium on Memory Management, pages 143--151, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. D. Bond and K. S. McKinley. Tolerating Memory Leaks. Technical Report TR-07-64, University of Texas at Austin, December 2007.Google ScholarGoogle Scholar
  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.Google ScholarGoogle ScholarCross RefCross Ref
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. DaCapo Benchmark Regression Tests. http://jikesrvm.anu.-edu.au/?dacapo/.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Eclipse.org Home. http://www.eclipse.org/.Google ScholarGoogle Scholar
  19. B. Goetz. Plugging memory leaks with weak references, 2005. http://www-128.ibm.com/developerworks/java/-library/j-jtp11225/.Google ScholarGoogle Scholar
  20. B. Goetz. Plugging memory leaks with soft references, 2006. http://www-128.ibm.com/developerworks/java/-library/j-jtp01246.html.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  24. R. Hastings and B. Joyce. Purify: Fast Detection of Memory Leaks and Access Errors. In Winter USENIX Conference, pages 125--136, 1992.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Jikes RVM. http://www.jikesrvm.org.Google ScholarGoogle Scholar
  33. Jikes RVM Research Archive. http://www.jikesrvm.org/-Research+Archive.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. J.Maebe, M. Ronsse, and K. D. Bosschere. Precise Detection of Memory Leaks. In International Workshop on Dynamic Analysis, pages 25--31, 2004.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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.Google ScholarGoogle Scholar
  39. J. E. B. Moss. Working with Persistent Objects: To Swizzle or Not to Swizzle. IEEE Transactions on Computers, 18(8):657--673, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Oracle. JRockit Mission Control. http://www.oracle.com/-technology/products/jrockit/missioncontrol/.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Quest. JProbe Memory Debugger. http://www.quest.com/-jprobe/debugger.asp.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. SciTech Software. .NET Memory Profiler. http://www.-scitech.se/memprofiler/.Google ScholarGoogle Scholar
  53. Standard Performance Evaluation Corporation. SPECjvm98 Documentation, release 1.03 edition, 1999.Google ScholarGoogle Scholar
  54. Standard Performance Evaluation Corporation. SPECjbb2000 Documentation, release 1.01 edition, 2001.Google ScholarGoogle Scholar
  55. Sun Developer Network Forum. Java Programming {Archive} - garbage collection dilema (sic), 2003. http://forum.java.-sun.com/thread.jspa?threadID=446934.Google ScholarGoogle Scholar
  56. Sun Developer Network Forum. Reflections & Reference Objects - Java memory leak example, 2003. http://forum.-java.sun.com/thread.jspa?threadID=456545.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  63. B. Zorn. Barrier Methods for Garbage Collection. Technical Report CU-CS-494-90, University of Colorado at Boulder, 1990.Google ScholarGoogle Scholar

Index Terms

  1. Tolerating memory leaks

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!