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.
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- BLACKBURN, S. M., AND HOSKING, A. L. Barriers: Friend or Foe? In ACM International Symposium on Memory Management (2004), pp. 143--151. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- HASTINGS, R., AND JOYCE, B. Purify: Fast Detection of Memory Leaks and Access Errors. In Winter USENIX Conference (1992), pp. 125--136.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- LINDHOLM, T., AND YELLIN, F. The Java Virtual Machine Specification, 2nd ed. Prentice Hall PTR, 1999. Google Scholar
Digital Library
- MAEBE, J., RONSSE, M., AND BOSSCHERE, K. D. Precise Detection of Memory Leaks. In International Workshop on Dynamic Analysis (2004), pp. 25--31.Google Scholar
- 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 Scholar
- MOON, D. A. Garbage Collection in a Large Lisp System. In ACM Conference on LISP and Functional Programming (1984), pp. 235--246. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- ORACLE. JRockit Mission Control. http://www.oracle. com/technology/products/jrockit/missioncontrol/.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- QUEST. JProbe Memory Debugger. http://www.quest.com/jprobe/debugger.asp.Google Scholar
- 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 Scholar
Digital Library
- SCITECH SOFTWARE. .NET Memory Profiler. http://www.scitech.se/memprofiler/.Google Scholar
- STANDARD PERFORMANCE EVALUATION CORPORATION. SPECjvm98 Documentation, release 1.03 ed., 1999.Google Scholar
- STANDARD PERFORMANCE EVALUATION CORPORATION. SPECjbb2000 Documentation, release 1.01 ed., 2001.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Leak pruning
Recommendations
Tolerating memory leaks
OOPSLA '08: Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applicationsType 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 ...
Leak pruning
ASPLOS 2009Managed 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-...
Leak pruning
ASPLOS 2009Managed 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-...








Comments