skip to main content
10.1145/320384.320386acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article
Free access

Escape analysis for Java

Published: 01 October 1999 Publication History

Abstract

This paper presents a simple and efficient data flow algorithm for escape analysis of objects in Java programs to determine (i) if an object can be allocated on the stack; (ii) if an object is accessed only by a single thread during its lifetime, so that synchronization operations on that object can be removed. We introduce a new program abstraction for escape analysis, the connection graph, that is used to establish reachability relationships between objects and object references. We show that the connection graph can be summarized for each method such that the same summary information may be used effectively in different calling contexts. We present an interprocedural algorithm that uses the above property to efficiently compute the connection graph and identify the non-escaping objects for methods and threads. The experimental results, from a prototype implementation of our framework in the IBM High Performance Compiler for Java, are very promising. The percentage of objects that may be allocated on the stack exceeds 70% of all dynamically created objects in three out of the ten benchmarks (with a median of 19%), 11% to 92% of all lock operations are eliminated in those ten programs (with a median of 51%), and the overall execution time reduction ranges from 2% to 23% (with a median of 7%) on a 333 MHz PowerPC workstation with 128 MB memory.

References

[1]
Jonathan Alridch, Craig Chambers, Emin Gun Sirer, and Susan Eggers. Static analysis for eliminating unnessary synchronization from java programs. In Proceedings of the Sixth International Static Analysis Symposium, Venezia, Italy, September 1999.]]
[2]
D. E Bacon, R. Konuru, C. Murthy, and M. Sen'ano. Thin locks: Featherweight synchronization for Java. In Proc. A CM SIGPLAN Conference on Programming Lan. guage Design and Implementation, Montreal, Canada, June 1998.]]
[3]
L. Birkedal, M. Tofte, and M. Vejlstrup. From region inference to yon Neumann machines via region representation inference. In Proc. 23rdAnnualACM Symposium on Principles of Programming Languages, January 1996.]]
[4]
B. Blanchet. Escape analysis: Correctness, proof, implementation and experimental results. In Proc. 25th Annual ACM Symposium on Principles of Programming Languages, pages 25-37, San Diego, CA, January 1998.]]
[5]
Bruno Blanchet. Escape analysis for object oriented languages: Application to Java. In Proceedings of ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, Denver, Colorado, November 1999.]]
[6]
Jeff Bodga and Urs H61zle. Removing unnecessay synchronization in java. In Proceedings of ACM SIG- PLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, Denver, Colorado, November 1999.]]
[7]
Michael Burke, Paul Carini, Jong-Deok Choi, and Michael Hind. Flow-insensitive interprocedural alias analysis in the presence of pointers. In K. Pingali, U. Banerjee, D. Gelernter, A. Nicolau, and D. Padua, editors, Lecture Notes in Computer Science, 892, pages 234-250. Springer-Verlag, I995. Proceedings from the 7th Workshop on Languages and Compilers for Parallel Computing. Extended version published as Research Report RC 19546, IBM T. J. Watson Research Center, September 1994.]]
[8]
Michael G. Burke, Jong-Deok Choi, Stephen Fink, David Grove, Michael Hind, Vivek Sarkar, Mauricio J. Serrano, V. C. Sreedhar, Harini Srinivasan, and John Whaley. The Jalapefio dynamic optimizing compiler for java. In Proc. A CM SIGPLAN 1999 Java Grande Conference, June 1999.]]
[9]
Jong-Deok Choi, David Grove, Michael Hind, and Vivek Sarkar. Efficient and Precise Modeling of Exceptions for the Analysis of Java Programs, 1999. To appear at PASTE '99.]]
[10]
James C. Corbett. Constructing compact models of concurrent java programs. In Proceedings of the 1998 International Symposium of Software Testing and Analysis. ACM Press, March 1998.]]
[11]
IBM Corporation. IBM High Performance Compiler for Java, 1997. Information available in Web page at http: //simontOl. torolab, ibm. com/hpj/hpj . available for download at http: //www. alphaWorks, ibm. com/formula.]]
[12]
A. Deutsch. On the complexity of escape analysis. In Proc. 24th Annual ACM Symposium on Principles of Programming Languages, pages 358-371, San Diego, CA, January 1997.]]
[13]
P. Diniz and M. Rinard. Synchronization Transformations for Parallel Computing. In Proceedings of the 9'th Workshop on Languages and Compilers for Parallel Computers, January 1997.]]
[14]
Julian Dolby. Automatic inline allocation of objects. In Proceedings of the 1997 ACM SIGPLAN Conference of Programming Language Design and Implementation, Las Vegas, Nevada, June 1997.]]
[15]
David Gay and Bjame Steensgaard. Stack allocating objects in Java. Research Report, Microsoft Research, 1999.]]
[16]
R. Ghiya and L. J. Hendren. Putting pointer analysis to work. In Proc. 25th Annual ACM Symposium on Principles of Programming Languages, pages 121-133, San Diego, CA, January 1998.]]
[17]
James Gosling, Bill Joy, and Guy Steele. The Java(TM) Language Specification. Addison-Wesley, 1996.]]
[18]
J. Hannan. A type-based analysis for stack allocation in functional languages. In Proc. 2nd International Static Analysis Symposium, September 1995.]]
[19]
Michael Hind, Michael Burke, Paul Carini, and Jong- Deok Choi. Interprocedural pointer alias analysis. A CM Transactions on Programming Languages and Systems, To appear.]]
[20]
Z. Li and W. Abu-Sufah. On reducing data synchronization in multiprocessed loops. IEEE Transactions on Computers, C-36(1):105-109, January 1987.]]
[21]
S.R Midkiff and D. Padua. Compiler algorithms for synchronization. IEEE Transactions on Computers, C- html, 36(12):1485-1495, December 1987.]]
[22]
Y.G. Park and B. Goldberg. Escape analysis on lists, In Proc. ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 117-127, July 1992.]]
[23]
A. Reid, J. McCorquodale, J. Baker, W. Hsieh, and J. Zachary. The need for predictable garbage collection. In WCSSS'99 Workshop on Compiler Support for System Software, March 1999.]]
[24]
C. Ruggieri and T.P. Murtagh. Lifetime analysis of dynamically allocated objects. In Proc. 15th Annual ACM Symposium on Principles of Programming Languages, pages 285-293, January 1988.]]
[25]
John Whaley and Martin Rinard. Compositional pointer and escape analysis for java programs. In Proceedings of ACM SIGPLAN Conference on Object.Oriented Programming Systems, Languages, and Applications, Denver, Colorado, November 1999.]]

Cited By

View all
  • (2024)The ART of Sharing Points-to Analysis: Reusing Points-to Analysis Results Safely and EfficientlyProceedings of the ACM on Programming Languages10.1145/36898038:OOPSLA2(2606-2632)Online publication date: 8-Oct-2024
  • (2024)MEA2: A Lightweight Field-Sensitive Escape Analysis with Points-to Calculation for GolangProceedings of the ACM on Programming Languages10.1145/36897598:OOPSLA2(1362-1389)Online publication date: 8-Oct-2024
  • (2024)Reducing Write Barrier Overheads for Orthogonal PersistenceProceedings of the 17th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3687997.3695646(210-223)Online publication date: 17-Oct-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
OOPSLA '99: Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
October 1999
462 pages
ISBN:1581132387
DOI:10.1145/320384
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 1999

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

OOPSLA99
Sponsor:

Acceptance Rates

OOPSLA '99 Paper Acceptance Rate 30 of 152 submissions, 20%;
Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)341
  • Downloads (Last 6 weeks)46
Reflects downloads up to 16 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)The ART of Sharing Points-to Analysis: Reusing Points-to Analysis Results Safely and EfficientlyProceedings of the ACM on Programming Languages10.1145/36898038:OOPSLA2(2606-2632)Online publication date: 8-Oct-2024
  • (2024)MEA2: A Lightweight Field-Sensitive Escape Analysis with Points-to Calculation for GolangProceedings of the ACM on Programming Languages10.1145/36897598:OOPSLA2(1362-1389)Online publication date: 8-Oct-2024
  • (2024)Reducing Write Barrier Overheads for Orthogonal PersistenceProceedings of the 17th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3687997.3695646(210-223)Online publication date: 17-Oct-2024
  • (2024)Optimistic Stack Allocation and Dynamic Heapification for Managed RuntimesProceedings of the ACM on Programming Languages10.1145/36563898:PLDI(296-319)Online publication date: 20-Jun-2024
  • (2023)Detecting API post-handling bugs using code and description in patchesProceedings of the 32nd USENIX Conference on Security Symposium10.5555/3620237.3620445(3709-3726)Online publication date: 9-Aug-2023
  • (2023)From Leaks to Fixes: Automated Repairs for Resource Leak WarningsProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616267(159-171)Online publication date: 30-Nov-2023
  • (2023)JITfuzz: Coverage-Guided Fuzzing for JVM Just-in-Time CompilersProceedings of the 45th International Conference on Software Engineering10.1109/ICSE48619.2023.00017(56-68)Online publication date: 14-May-2023
  • (2022)Optimizing Parallel Java Streams2022 26th International Conference on Engineering of Complex Computer Systems (ICECCS)10.1109/ICECCS54210.2022.00012(23-32)Online publication date: Mar-2022
  • (2021)Canary: practical static detection of inter-thread value-flow bugsProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454099(1126-1140)Online publication date: 19-Jun-2021
  • (2021)Synthesizing Multi-threaded Tests from Sequential Traces to Detect Communication Deadlocks2021 14th IEEE Conference on Software Testing, Verification and Validation (ICST)10.1109/ICST49551.2021.00013(1-12)Online publication date: Apr-2021
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media