skip to main content
10.1145/1508244.1508277acmconferencesArticle/Chapter ViewAbstractPublication PagesasplosConference Proceedingsconference-collections
research-article

Leak pruning

Published:07 March 2009Publication History

ABSTRACT

Managed languages improve programmer productivity with type safety and garbage collection, which eliminate memory errors such as dangling pointers, double frees, and buffer overflows. However, because garbage collection uses reachability to over-approximate live objects, programs may still leak memory if programmers forget to eliminate the last reference to an object that will not be used again. Leaks slow programs by increasing collector workload and frequency. Growing leaks eventually crash programs.

This paper introduces leak pruning, which keeps programs running by predicting and reclaiming leaked objects at run time. It predicts dead objects and reclaims them based on observing data structure usage patterns. Leak pruning preserves semantics because it waits for heap exhaustion before reclaiming objects and poisons references to objects it reclaims. If the program later tries to access a poisoned reference, the virtual machine (VM) throws an error. We show leak pruning has low overhead in a Java VM and evaluate it on 10 leaking programs. Leak pruning does not help two programs, executes five substantial programs 1.6-81X longer, and executes three programs, including a leak in Eclipse, for at least 24 hours. In the worst case, leak pruning defers fatal errors. In the best case, it keeps leaky programs running with preserved semantics and consistent throughput.

References

  1. ALPERN, B., ATTANASIO, C. R., BARTON, J. J., BURKE, M. G., CHENG, P., CHOI, J.--D., COCCHI, A., FINK, S. J., GROVE, D., HIND, M., HUMMEL, S. F., LIEBER, D., LITVINOV, V., MERGEN, M., NGO, T., RUSSELL, J. R., SARKAR, V., SERRANO, M. J., SHEPHERD, J., SMITH, S., SREEDHAR, V. C., SRINIVASAN, H., AND WHALEY, J. The JalapeÜno Virtual Machine. IBM Systems Journal 39, 1 (2000), 211--238. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. ARNOLD, M., FINK, S. J., GROVE, D., HIND, M., AND SWEENEY, P. F. Adaptive Optimization in the JalapeÜno JVM. In ACM Conference on Object--Oriented Programming, Systems, Languages, and Applications (2000), pp. 47--65. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. BERGER, E. D., AND ZORN, B. G. DieHard: Probabilistic Memory Safety for Unsafe Languages. In ACMConference on Programming Language Design and Implementation (2006), pp. 158--168. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. BLACKBURN, S. M., CHENG, P., AND MCKINLEY, K. S. Oil and Water? High Performance Garbage Collection in Java with MMTk. In ACM International Conference on Software Engineering (2004), pp. 137--146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. BLACKBURN, S. M., GARNER, R., HOFFMAN, C., KHAN, A. M., MCKINLEY, K. S., BENTZUR, R., DIWAN, A., FEINBERG, D., FRAMPTON, D., GUYER, S. Z., HIRZEL, M., HOSKING, A., JUMP, M., LEE, H., MOSS, J. E. B., PHANSALKAR, A., STEFANOVIć, D., VANDRUNEN, T., VON DINCKLAGE, D., AND WIEDERMANN, B. The DaCapo Benchmarks: Java Benchmarking Development and Analysis. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (2006), pp. 169--190. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. BLACKBURN, S. M., AND HOSKING, A. L. Barriers: Friend or Foe? In ACM International Symposium on Memory Management (2004), pp. 143--151. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. BOND, M. D., AND MCKINLEY, K. S. Bell: Bit-Encoding Online Memory Leak Detection. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems (2006), pp. 61--72. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. BOND, M. D., AND MCKINLEY, K. S. Tolerating Memory Leaks. In ACMConference on Object-Oriented Programming, Systems, Languages, and Applications (2008), pp. 109--126. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. BREITGAND, D., GOLDSTEIN, M., HENIS, E., SHEHORY, O., AND WEINSBERG, Y. PANACEA--Towards a Self-Healing Development Framework. In Integrated Network Management (2007), pp. 169--178.Google ScholarGoogle ScholarCross RefCross Ref
  10. CHEREM, S., PRINCEHOUSE, L., AND RUGINA, R. Practical Memory Leak Detection using Guarded Value-Flow Analysis. In ACM Conference on Programming Language Design and Implementation (2007), pp. 480--491. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. CHILIMBI, T. M., AND HAUSWIRTH, M. Low-Overhead Memory Leak Detection Using Adaptive Statistical Profiling. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems (2004), pp. 156--164. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. CLICK, C., TENE, G., AND WOLF, M. The Pauseless GC Algorithm. In ACM/USENIX International Conference on Virtual Execution Environments (2005), pp. 46--56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. CORMEN, T. H., LEISERSON, C. E., RIVEST, R. L., AND STEIN, C. Introduction to Algorithms, 2nd ed. TheMIT Press, McGraw-Hill Book Company, 2001, ch. 11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. GEORGES, A., EECKHOUT, L., AND BUYTAERT, D. Java Performance Evaluation through Rigorous Replay Compilation. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (2008), pp. 367--384. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. GOLDSTEIN, M., SHEHORY, O., AND WEINSBERG, Y. Can Self-Healing Software Cope With Loitering? In International Workshop on Software Quality Assurance (2007), pp. 1--8. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. HASTINGS, R., AND JOYCE, B. Purify: Fast Detection of Memory Leaks and Access Errors. In Winter USENIX Conference (1992), pp. 125--136.Google ScholarGoogle Scholar
  17. HEINE, D. L., AND LAM, M. S. A Practical Flow-Sensitive and Context-Sensitive C and C++ Memory Leak Detector. In ACM Conference on Programming Language Design and Implementation (2003), pp. 168--181. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. HERTZ, M., FENG, Y., AND BERGER, E. D. Garbage Collection without Paging. In ACM Conference on Programming Language Design and Implementation (2005), pp. 143--153. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. JUMP, M., AND MCKINLEY, K. S. Cork: Dynamic Memory Leak Detection for Garbage-Collected Languages. In ACM Symposium on Principles of Programming Languages (2007), pp. 31--38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. LINDHOLM, T., AND YELLIN, F. The Java Virtual Machine Specification, 2nd ed. Prentice Hall PTR, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. MAEBE, J., RONSSE, M., AND BOSSCHERE, K. D. Precise Detection of Memory Leaks. In International Workshop on Dynamic Analysis (2004), pp. 25--31.Google ScholarGoogle Scholar
  22. MITCHELL, N., AND SEVITSKY, G. LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications. In European Conference on Object-Oriented Programming (2003), pp. 351--377.Google ScholarGoogle Scholar
  23. MOON, D. A. Garbage Collection in a Large Lisp System. In ACM Conference on LISP and Functional Programming (1984), pp. 235--246. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. NETHERCOTE,N., AND SEWARD, J. Valgrind: A Framework for Heavyweight Dynamic Binary Instrumentation. In ACM Conference on Programming Language Design and Implementation (2007), pp. 89--100. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. NGUYEN, H. H., AND RINARD, M. Detecting and Eliminating Memory Leaks Using CyclicMemory Allocation. In ACM International Symposium on Memory Management (2007), pp. 15--29. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. NOVARK, G., BERGER, E. D., AND ZORN, B. G. Plug: Automatically Tolerating Memory Leaks in C and C++ Applications. Tech. Rep. UM-CS-2008-009, University of Massachusetts, 2008.Google ScholarGoogle Scholar
  27. ORACLE. JRockit Mission Control. http://www.oracle. com/technology/products/jrockit/missioncontrol/.Google ScholarGoogle Scholar
  28. QIN, F., LU, S., AND ZHOU, Y. SafeMem: Exploiting ECC-Memory for Detecting Memory Leaks and Memory Corruption During Production Runs. In International Symposium on High-Performance Computer Architecture (2005), pp. 291--302. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. QIN, F., TUCEK, J., SUNDARESAN, J., AND ZHOU, Y. Rx: Treating Bugs as Allergies--A Safe Method to Survive Software Failures. In ACM Symposium on Operating Systems Principles (2005), pp. 235--248. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. QUEST. JProbe Memory Debugger. http://www.quest.com/jprobe/debugger.asp.Google ScholarGoogle Scholar
  31. RINARD, M., CADAR, C., DUMITRAN, D., ROY, D., LEU, T., AND BEEBEE, W. Enhancing Server Availability and Security through Failure-Oblivious Computing. In USENIX Symposium on Operating Systems Design and Implementation (2004), pp. 303--316. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. SCITECH SOFTWARE. .NET Memory Profiler. http://www.scitech.se/memprofiler/.Google ScholarGoogle Scholar
  33. STANDARD PERFORMANCE EVALUATION CORPORATION. SPECjvm98 Documentation, release 1.03 ed., 1999.Google ScholarGoogle Scholar
  34. STANDARD PERFORMANCE EVALUATION CORPORATION. SPECjbb2000 Documentation, release 1.01 ed., 2001.Google ScholarGoogle Scholar
  35. TANG, Y., GAO, Q., AND QIN, F. LeakSurvivor: Towards Safely Tolerating Memory Leaks for Garbage-Collected Languages. In USENIX Annual Technical Conference (2008), pp. 307--320. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. WHITE, J. L. Address/Memory Management For A Gigantic LISP Environment or, GC Considered Harmful. In ACM Conference on LISP and Functional Programming (1980), pp. 119--127. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. YANG, T., BERGER, E. D., KAPLAN, S. F., AND MOSS, J. E. B. CRAMM: Virtual Memory Support for Garbage-Collected Applications. In USENIX Symposium on Operating Systems Design and Implementation (2006), pp. 103--116. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Leak pruning

      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!