skip to main content
10.1145/2568225.2568311acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Automated memory leak detection for production use

Published:31 May 2014Publication History

ABSTRACT

This paper presents Sniper, an automated memory leak detection tool for C/C++ production software. To track the staleness of allocated memory (which is a clue to potential leaks) with little overhead (mostly <3%), Sniper leverages instruction sampling using performance monitoring units available in commodity processors. It also offloads the time- and space-consuming analyses, and works on the original software without modifying the underlying memory allocator; it neither perturbs the application execution nor increases the heap size. The Sniper can even deal with multithreaded applications with very low overhead. In particular, it performs a statistical analysis, which views memory leaks as anomalies, for automated and systematic leak determination. Consequently, it accurately detected real-world memory leaks with no false positive, and achieved an F-measure of 81% on average for 17 benchmarks stress-tested with various memory leaks.

References

  1. packet-o-matic. http://www.packet-o-matic.org/.Google ScholarGoogle Scholar
  2. Squid: Optimising web delivery. http://www.squid-cache.org/.Google ScholarGoogle Scholar
  3. Red hat enterprise linux 6. Technical report, Red Hat, 2012.Google ScholarGoogle Scholar
  4. C. Bienia, S. Kumar, J. P. Singh, and K. Li. The PARSEC Benchmark Suite: Characterization and Architectural Implications. In Proc. of the 17th PACT, Oct. 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. H. J. Boehm. Space efficient conservative garbage collection. SIGPLAN Not., 39:490–501, April 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. M. Bond and K. McKinley. Tolerating memory leaks. In Proceedings of the 23rd ACM SIGPLAN OOPSLA. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. D. Bond and K. McKinley. Leak pruning. In Proceeding of the 14th ASPLOS, pages 277–288. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. D. Bond and K. S. McKinley. Bell: bit-encoding online memory leak detection. In Proc. of the 12th ASPLOS, New York, USA, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Bruening and Q. Zhao. Practical memory checking with dr. memory. In Proc. of the 9th CGO, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D. Chen, N. Vachharajani, R. Hundt, X. Li, S. Eranian, W. Chen, and W. Zheng. Taming hardware event samples for precise and versatile feedback directed optimizations. Computers, IEEE Transactions on. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Cherem, L. Princehouse, and R. Rugina. Practical memory leak detection using guarded value-flow analysis. In Proc. of 28th PLDI’07. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. T. M. Chilimbi and M. Hauswirth. Low-overhead memory leak detection using adaptive statistical profiling. In Proc. of 11th ASPLOS’04. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. Clause and A. Orso. Leakpoint: pinpointing the causes of memory leaks. In Proc. of the 32nd ICSE, New York, NY, USA, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. CVE Details. Common Vulnerabilities and Exposures (CVE), 2013. http://www.cvedetails.com.Google ScholarGoogle Scholar
  15. CWE Details. Common Weakness Enumeration (CWE), 2013. http://cwe.mitre.org/data/definitions/401.html.Google ScholarGoogle Scholar
  16. J. Dean and S. Ghemawat. Mapreduce: simplified data processing on large clusters. In Proc. of 5th USENIX OSDI, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. P. J. Drongowski. Instruction-based sampling: A new performance analysis technique for amd family 10h processors, 2007.Google ScholarGoogle Scholar
  18. S. Eranian. Perfmon2: a Standard Performance Monitoring Interface.Google ScholarGoogle Scholar
  19. R. Hastings and B. Joyce. Purify: Fast detection of memory leaks and access errors. In Proc. of the 1992 USENIX Winter Conference.Google ScholarGoogle Scholar
  20. D. L. Heine and M. S. Lam. A practical flow- and context-sensitive c/c++ memory leak detector. In Proc. of the 23rd PLDI, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Intel Corporation. Intel R Microarchitecture Codename Nehalem Performance Monitoring Unit Programming Guide, 2010.Google ScholarGoogle Scholar
  22. Journal of Instruction Level Parallelism. 3rd workshop on computer architecture competitions: Memory scheduling championship, 2012.Google ScholarGoogle Scholar
  23. C. Jung and N. Clark. Ddt: design and evaluation of a dynamic program analysis for optimizing data structure usage. In Proceedings of the 42nd Annual IEEE/ACM International Symposium on Microarchitecture, MICRO 42nd, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. C. Jung, S. Rus, B. P. Railing, N. Clark, and S. Pande. Brainy: effective selection of data structures. In Proceedings of the 32nd ACM SIGPLAN conference on Programming language design and implementation, PLDI ’11, pages 86–97, New York, NY, USA, 2011. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. C. Jung, D.-K. Woo, K. Kim, and S.-S. Lim. Performance characterization of prelinking and preloading for embedded systems. In Proc. of the 7th ACM & IEEE EMSOFT, New York, NY, USA, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Y. Jung and K. Yi. Practical memory leak detector based on parameterized procedural summaries. In Proc. of the 7th ISMM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S. Lee, C. Jung, and S. Pande. Detecting memory leaks through introspective dynamic behavior modelling using machine learning. In Proceedings of the 36th International Conference on Software Engineering, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Mars, L. Tang, R. Hundt, K. Skadron, and M. L. Soffa. Bubble-up: Increasing utilization in modern warehouse scale computers via sensible co-locations. In MICRO ’11: Proceedings of The 44th Annual IEEE/ACM International Symposium on Microarchitecture, New York, NY, USA, 2011. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. E. K. Maxwell, G. Back, and N. Ramakrishnan. Diagnosing memory leaks using graph mining on heap dumps. In Proceedings of the 16th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’10, pages 115–124, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. B. Meredith. Omega: An instant leak detector tool for Valgrind, 2008. http://www.brainmurders.eclipse.co.uk/omega.html.Google ScholarGoogle Scholar
  31. Michael Procopio. Cloud computing does not require virtualization, 2011. http://www.enterprisecioforum.com.Google ScholarGoogle Scholar
  32. Microsoft SharePoint Foundation. Hyper-V Performance Tests, 2010. http://technet.microsoft.com/en-us/library/gg454734.aspx.Google ScholarGoogle Scholar
  33. Mozilla.org. Mozilla Bugzilla, 2014. https://bugzilla.mozilla.org.Google ScholarGoogle Scholar
  34. N. Nagappan, E. M. Maximilien, T. Bhat, and L. Williams. Realizing quality improvement through test driven development: results and experiences of four industrial teams. Empirical Softw. Eng., 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. N. Nethercote and J. Seward. Valgrind: A framework for heavyweight dynamic binary instrumentation. In Proc. of the 28th PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. R. Nikolaev and G. Back. Perfctr-xen: a framework for performance counter virtualization. In Proc. of the 7th ACM SIGPLAN/SIGOPS international conference on Virtual execution environments, VEE ’11, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. G. Novark, E. D. Berger, and B. G. Zorn. Efficiently and precisely locating memory leaks and bloat. In Proc. of the 30th PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. M. Ovsiannikov, S. Rus, D. Reeves, P. Sutter, S. Rao, and J. Kelly. A the quantcast file system. PVLDB, 6(11):1092–1101, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. F. Qin, S. Lu, and Y. Zhou. Safemem: Exploiting ecc-memory for detecting memory leaks and memory corruption during production runs. In Proc. of the 11th HPCA, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. S. Eranian. Perfmon2: a flexible performance monitoring interface for linux. In In Ottawa Linux Symposium (OLS), 2006.Google ScholarGoogle Scholar
  41. K. Shvachko, H. Kuang, S. Radia, and R. Chansler. The hadoop distributed file system. In Proceedings of the 2010 IEEE 26th Symposium on Mass Storage Systems and Technologies (MSST), MSST ’10, pages 1–10, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. J. Sundararaman and G. Back. Hdpv: Interactive, faithful, in-vivo runtime state visualization for c/c++ and java. In Proceedings of the 4th ACM Symposium on Software Visualization, SoftVis ’08, pages 47–56, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. J. Whittaker. How to Break Software Security. Addision Wesley.Google ScholarGoogle Scholar
  44. R. Wilcox. Introduction to Robust Estimation and Hypothesis Testing. Elsevier Science & Technology, 2012.Google ScholarGoogle Scholar
  45. Y. Xie and A. Aiken. Context- and path-sensitive memory leak detection. In Proc. of FSE. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. G. Xu, M. D. Bond, F. Qin, and A. Rountev. Leakchaser: helping programmers narrow down causes of memory leaks. In Proc. of the 32nd PLDI, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. G. Xu and A. Rountev. Precise memory leak detection for java software using container profiling. In Proc. of ICSE, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. G. Xu and A. Rountev. Precise memory leak detection for java software using container profiling. ACM Trans. Softw. Eng. Methodol., 22(3):17:1–17:28, July 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. D. Yan, G. Xu, S. Yang, and A. Rountev. LeakChecker: Practical static memory leak detection for managed languages. In International Symposium on Code Generation and Optimization, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. J. Yang, P. Twohey, and D. Engler. Using model checking to find serious file system errors. In In Proc. OSDI 2004, pages 273–288, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. J. Yang, P. Twohey, D. Engler, and M. Musuvathi. Using model checking to find serious file system errors. ACM Trans. Comput. Syst., 24(4):393–423, Nov. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Automated memory leak detection for production use

                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
                • Published in

                  cover image ACM Conferences
                  ICSE 2014: Proceedings of the 36th International Conference on Software Engineering
                  May 2014
                  1139 pages
                  ISBN:9781450327565
                  DOI:10.1145/2568225

                  Copyright © 2014 ACM

                  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: 31 May 2014

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • research-article

                  Acceptance Rates

                  Overall Acceptance Rate276of1,856submissions,15%

                  Upcoming Conference

                  ICSE 2025

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader