skip to main content
10.1145/2786805.2786860acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

MemInsight: platform-independent memory debugging for JavaScript

Published: 30 August 2015 Publication History

Abstract

JavaScript programs often suffer from memory issues that can either hurt performance or eventually cause memory exhaustion. While existing snapshot-based profiling tools can be helpful, the information provided is limited to the coarse granularity at which snapshots can be taken. We present MemInsight, a tool that provides detailed, time-varying analysis of the memory behavior of JavaScript applications, including web applications. MemInsight is platform independent and runs on unmodified JavaScript engines. It employs tuned source-code instrumentation to generate a trace of memory allocations and accesses, and it leverages modern browser features to track precise information for DOM (document object model) objects. It also computes exact object lifetimes without any garbage collector assistance, and exposes this information in an easily-consumable manner for further analysis. We describe several client analyses built into MemInsight, including detection of possible memory leaks and opportunities for stack allocation and object inlining. An experimental evaluation showed that with no modifications to the runtime, MemInsight was able to expose memory issues in several real-world applications.

References

[1]
E. Aftandilian and S. Z. Guyer. GC assertions: using the garbage collector to check heap properties. In PLDI, pages 235–244, 2009.
[2]
Annex. HTML5WebApps - Annex. https://01.org/ html5webapps/webapps/annex. Accessed: 2015-07-14.
[3]
M. D. Bond and K. S. McKinley. Bell: bit-encoding online memory leak detection. In ASPLOS, pages 61–72, 2006.
[4]
T. M. Chilimbi and M. Hauswirth. Low-overhead memory leak detection using adaptive statistical profiling. In ASPLOS, pages 156–164, 2004.
[5]
ChromeDevTools. Chrome developer tools overview. https://developer.chrome.com/devtools/index. Accessed: 2015-07-14.
[6]
W. Clinger, A. Hartheimer, and E. Ost. Implementation strategies for continuations. In Proceedings of the 1988 ACM Conference on LISP and Functional Programming, LFP ’88, pages 124–131, New York, NY, USA, 1988.
[7]
ACM. ISBN 0-89791-273-X. URL http://doi.acm.org/10.1145/62678.62692.
[8]
DataTables. Datatables - table plug-in for jQuery. http: //datatables.net/. Accessed: 2015-07-14.
[9]
DataTablesLeak. Datatables patch-1. http://www. mozartrocks.ro/dt-test/patch-1.html. Accessed: 2015-07-14.
[10]
J. Dolby and A. Chien. An automatic object inlining optimization and its evaluation. In PLDI, 2000. ISBN 1-58113-199-2. URL http: //doi.acm.org/10.1145/349299.349344.
[11]
Escodegen. Escodegen. https://github.com/ Constellation/escodegen. Accessed: 2015-07-14.
[12]
Esprima. Esprima. http://esprima.org. Accessed: 2015-07-14.
[13]
GlobalObject. ECMAScript language specification - ECMA-262 edition 5.1: The global object. http://www. ecma-international.org/ecma-262/5.1/#sec-15.1. Accessed: 2015-07-14.
[14]
HackerWeb. Hackerweb – a simply readable hacker news web app. http://hackerwebapp.com/. Accessed: 2015-07-14.
[15]
M. Hertz, S. M. Blackburn, J. E. B. Moss, K. S. McKinley, and D. Stefanovic. Generating object lifetime traces with Merlin. ACM Trans. Program. Lang. Syst., 28(3): 476–516, 2006.
[16]
S. Jensen, M. Sridharan, K. Sen, and S. Chandra. Meminsight: Platform-independent memory debugging for JavaScript. Technical Report SRA-FCS-2015-001, Samsung Research America, 2015.
[17]
jQuery. jQuery. http://jquery.com. Accessed: 2015- 07-14.
[18]
M. Jump and K. S. McKinley. Cork: dynamic memory leak detection for garbage-collected languages. In POPL, pages 31–38, 2007.
[19]
E. Kiciman and B. Livshits. AjaxScope: A platform for remotely monitoring the client-side behavior of Web 2.0 applications. ACM Trans. Web, 4(4):13:1–13:52, Sept. 2010. ISSN 1559-1131.
[20]
1841910. URL http://doi.acm.org/10.1145/1841909.
[21]
[22]
O. Lhoták and L. Hendren. Run-time evaluation of opportunities for object inlining in Java. Concurrency and Computation: Practice and Experience, 17(5-6): 515–537, 2005.
[23]
R. D. Lins. Cyclic reference counting with lazy markscan. Inf. Process. Lett., 44(4):215–220, 1992.
[24]
C.-K. Luk, R. Cohn, R. Muth, H. Patil, A. Klauser, G. Lowney, S. Wallace, V. J. Reddi, and K. Hazelwood. Pin: Building customized program analysis tools with dynamic instrumentation. In PLDI, pages 190– 200, 2005. ISBN 1-59593-056-6.
[25]
1065034. URL http://doi.acm.org/10.1145/1065010.
[26]
[27]
D. Marinov and R. O’Callahan. Object equality profiling. In OOPSLA, pages 313–325, 2003.
[28]
N. Mitchell. The runtime structure of object ownership. In ECOOP, pages 74–98, 2006.
[29]
N. Mitchell and G. Sevitsky. Leakbot: An automated and lightweight tool for diagnosing memory leaks in large Java applications. In ECOOP, pages 351–377, 2003.
[30]
MutationObservers. DOM standard: Mutation observers. http://dom.spec.whatwg.org/ #mutation-observers. Accessed: 2015-07-14.
[31]
N. Nethercote and J. Seward. Valgrind: A framework for heavyweight dynamic binary instrumentation. In PLDI, 2007. ISBN 978-1-59593-633-2. 1250734.1250746. URL http://doi.acm.org/10.1145/ 1250734.1250746.
[32]
M. D. Network. Working with objects: Defining getters and setters. https://developer.mozilla.org/ en-US/docs/Web/JavaScript/Guide/Working_with_ Objects#Defining_getters_and_setters. Accessed: 2015-07-14.
[33]
K. Nguyen and G. H. Xu. Cachetor: detecting cacheable data to remove bloat. In ESEC/FSE, 2013. 1145/2491411.2491416. URL http://doi.acm.org/10. 1145/2491411.2491416.
[34]
OctaneBenchmarks. Octane. https://developers. google.com/octane/. Accessed: 2015-07-14.
[35]
J. Piennar and R. Hundt. JSWhiz - static analysis for JavaScript memory leaks. In Proceedings of the 10th annual IEEE/ACM international symposium on Code generation and optimization, 2013.
[36]
N. P. Ricci, S. Z. Guyer, and J. E. B. Moss. Elephant Tracks: portable production of complete and precise GC traces. In ISMM, pages 109–118, 2013.
[37]
N. Röjemo and C. Runciman. Lag, drag, void and use; heap profiling and space-efficient compilation revisited. In Proceedings of the First ACM SIGPLAN International Conference on Functional Programming, ICFP ’96, pages 34–41, New York, NY, USA, 1996. ACM. ISBN 0-89791-770-7. URL http://doi.acm.org/10.1145/232627.232633.
[38]
K. Sen, S. Kalasapur, T. Brutch, and S. Gibbs. Jalangi: A selective record-replay and dynamic analysis framework for JavaScript. In ESEC/FSE, 2013. ISBN 978- 1-4503-2237-9. URL http://doi.acm.org/10.1145/2491411.2491447.
[39]
R. Shaham, E. K. Kolodner, and M. Sagiv. On the effectiveness of GC in Java. In ISMM, 2000.
[40]
R. Shaham, E. K. Kolodner, and M. Sagiv. Heap profiling for space-efficient Java. In PLDI, 2001. ISBN 1-58113-414-2. URL http://doi.acm.org/10.1145/378795.378820.
[41]
Shopping List. HTML5WebApps - Shopping list. https: //01.org/html5webapps/webapps/shopping-list. Accessed: 2015-07-14.
[42]
B. Xin, W. N. Sumner, and X. Zhang. Efficient program execution indexing. In PLDI, pages 238–248, 2008.
[43]
G. H. Xu. Finding reusable data structures. In OOPSLA, 2012.
[44]
G. H. Xu. Resurrector: a tunable object lifetime profiling technique for optimizing real-world programs. In OOPSLA, pages 111–130, 2013.
[45]
G. H. Xu, M. Arnold, N. Mitchell, A. Rountev, and G. Sevitsky. Go with the flow: profiling copies to find runtime bloat. In PLDI, pages 419–430, 2009. URL http://doi.acm.org/ 10.1145/1542476.1542523.
[46]
G. H. Xu, M. D. Bond, F. Qin, and A. Rountev. Leakchaser: helping programmers narrow down causes of memory leaks. In PLDI, pages 270–282, 2011.
[47]
D. Yan, G. H. Xu, and A. Rountev. Uncovering performance problems in Java applications with reference propagation profiling. In ICSE, 2012.
[48]
URL http://dx.doi.org/ 10.1109/ICSE.2012.6227199.

Cited By

View all
  • (2024)SecPassInput: Towards Secure Memory and Password Handling in Web ApplicationsICT Systems Security and Privacy Protection10.1007/978-3-031-56326-3_17(236-249)Online publication date: 24-Apr-2024
  • (2023)LeakPair: Proactive Repairing of Memory Leaks in Single Page Web ApplicationsProceedings of the 38th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE56229.2023.00097(1175-1187)Online publication date: 11-Nov-2023
  • (2021)Automatically Assessing and Extending Code Coverage for NPM Packages2021 IEEE/ACM International Conference on Automation of Software Test (AST)10.1109/AST52587.2021.00013(40-49)Online publication date: May-2021
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ESEC/FSE 2015: Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering
August 2015
1068 pages
ISBN:9781450336758
DOI:10.1145/2786805
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 the author(s) 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].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 30 August 2015

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Memory profiling
  2. leak detection

Qualifiers

  • Research-article

Conference

ESEC/FSE'15
Sponsor:

Acceptance Rates

Overall Acceptance Rate 112 of 543 submissions, 21%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)18
  • Downloads (Last 6 weeks)1
Reflects downloads up to 28 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)SecPassInput: Towards Secure Memory and Password Handling in Web ApplicationsICT Systems Security and Privacy Protection10.1007/978-3-031-56326-3_17(236-249)Online publication date: 24-Apr-2024
  • (2023)LeakPair: Proactive Repairing of Memory Leaks in Single Page Web ApplicationsProceedings of the 38th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE56229.2023.00097(1175-1187)Online publication date: 11-Nov-2023
  • (2021)Automatically Assessing and Extending Code Coverage for NPM Packages2021 IEEE/ACM International Conference on Automation of Software Test (AST)10.1109/AST52587.2021.00013(40-49)Online publication date: May-2021
  • (2020)Client Insourcing: Bringing Ops In-House for Seamless Re-engineering of Full-Stack JavaScript ApplicationsProceedings of The Web Conference 202010.1145/3366423.3380105(179-189)Online publication date: 20-Apr-2020
  • (2020)Industry practice of Javascript dynamic analysis on WeChat mini-programsProceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering10.1145/3324884.3421842(1189-1193)Online publication date: 21-Dec-2020
  • (2020)TANDEM: A Taxonomy and a Dataset of Real-World Performance BugsIEEE Access10.1109/ACCESS.2020.30009288(107214-107228)Online publication date: 2020
  • (2020)Actionable Program Analyses for Improving Software PerformanceErnst Denert Award for Software Engineering 201910.1007/978-3-030-58617-1_7(113-140)Online publication date: 4-Dec-2020
  • (2019)Analysis of cache behaviour and software optimizations for faster on-chip network simulationsInternational Journal of System Assurance Engineering and Management10.1007/s13198-019-00799-5Online publication date: 14-May-2019
  • (2019)Catch & Release: An Approach to Debugging Distributed Full-Stack JavaScript ApplicationsWeb Engineering10.1007/978-3-030-19274-7_32(459-473)Online publication date: 26-Apr-2019
  • (2018)Write-rationing garbage collection for hybrid memoriesACM SIGPLAN Notices10.1145/3296979.319239253:4(62-77)Online publication date: 11-Jun-2018
  • 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

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media