Abstract
This paper presents and evaluates a set of analyses designed to reduce synchronization overhead in Java programs. Monitor-based synchronization in Java often causes significant overhead, accounting for 5–10% of total execution time in our benchmark applications. To reduce this overhead, programmers often try to eliminate unnecessary lock operations by hand. Such manual optimizations are tedious, error-prone, and often result in poorly structured and less reusable programs. Our approach replaces manual optimizations with static analyses that automatically find and remove unnecessary synchronization from Java programs. These analyses optimize cases where a monitor is entered multiple times by a single thread, where one monitor is nested within another, and where a monitor is accessible by only one thread. A partial implementation of our analyses eliminates up to 70% of synchronization overhead and improves running time by up to 5% for several already hand-optimized benchmarks. Thus, our automated analyses have the potential to significantly improve the performance of Java applications while enabling programmers to design simpler and more reusable multithreaded code.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
T. E. Anderson, E. D. Lazowska and H. M. Levy. The Performance Implications of Thread Management Alternatives for Shared-Memory Multiprocessors. IEEE Transactions on Computers 38(12), December 1989, pp. 1631–1644.
D. Bacon, R. Konuru, C. Murthy, M. Serrano. Thin Locks: Featherweight Synchronization for Java. In Proceedings of the 1998 Conference on Programming Language Design and Implementation, Montreal, Canada, June 1998.
H. Boehm and M. Weiser. Garbage Collection in an Uncooperative Environment. Software Practice & Experience, September 1988, pp. 807–820.
J. Corbett. Using Shape Analysis to Reduce Finite-State Models of Concurrent Java Programs. In Proceedings of the International Symposium on Software Testing and Analysis, March 1998. A more recent version is University of Hawaii ICS-TR-98-20, available at http://www.ics.hawaii.edu/~corbett/pubs.html.
J. Dean, G. DeFouw, D. Grove, V. Litvinov, and C. Chambers. Vortex: An Optimizing Compiler for Object-Oriented Languages. In Proceedings of the Eleventh Conference on Object-Oriented Programming, Systems, Languages, and Applications, October 1996.
David L. Detlefs, K. Rustan, M. Leino, Greg Nelson, and James B. Saxe. Extended Static Checking. Compaq SRC Research Report 159. 1998.
P. Diniz and M. Rinard. Lock Coarsening: Eliminating Lock Overhead in Automatically Parallelized Object-based Programs. In Journal of Parallel and Distributed Computing, Volume 49,Number 2, March 1998, pp. 218–244.
J. Dolby. Automatic Inline Allocation of Objects. In Proceedings of the 1997 ACM SIGPLAN Conference on Programming Language Design and Implementation, June 1997.
C. M. Geschke, J. H. Morris and E. H. Satterthwaite. Early Experiences with Mesa. Communications of the Association for Computing Machinery, 20(8), August 1977, pp. 540–553.
J. Gosling, B. Joy, and G. Steele. The Java Language Specification. Addison-Wesley, 1996.
D. Grove, G. DeFouw, J. Dean, and C. Chambers. Call Graph Construction in Object-Oriented Languages. In Proceedings of the 12th Conference on Object-Oriented Programming, Systems, Languages, and Applications, 1997.
J. Hogg. Islands: Aliasing Protection in Object-Oriented Languages. In Proceedings of the Sixth Conference on Object-Oriented Programming, Systems, Languages, and Applications, November 1991.
D. Keppel. Tools and Techniques for Building Fast Portable Thread Packages. University of Washington Technical Report UW CSE 93-05-06, May 1993.
A. Krall and M. Probst. Monitors and Exceptions: How to implement Java efficiently. ACM 1998 Workshop on Java for High-Performance Network Computing, 1998.
B. Lampson and D. Redell. Experience with Processes and Monitors in Mesa. In Communications of the Association for Computing Machinery 23(2), February 1980, pp. 105–117.
N. Minsky. Towards Alias-Free Pointers. In Proceedings of the 10th European Conference on Object Oriented Programming, Linz, Austria July 1996.
J. Noble, J. Vitek, and J. Potter. Flexible Alias Protection. In Proceedings of the 12th European Conference on Object Oriented Programming, Brussels, Belgium, July 1998.
J. Plevyak, X. Zhang, and A. Chien. Obtaining Sequential Efficiency for Concurrent Object-Oriented Languages. In Proceedings of the 22nd Symposium on Principles of Programming Languages, San Francisco, CA, January 1995.
Olin Shivers. Control-Flow Analysis in Scheme. SIGPLAN Notices, 23(7):164–174, July 1988. In Proceedings of the ACM SIGPLAN’ 88 Conference on Programming Language Design and Implementation.
S. Singhal, B. Nguyen, R. Redpath, M. Fraenkel, and J. Nguyen. Building High-Performance Applications and Services in Java: An Experiential Study. IBM T.J. Watson Research Center white paper, available at http://www.ibm.com/java/education/javahipr.html. 1997.
E. G. Sirer, A. J. Gregory, N.R. Anderson, B.N. Bershad. Distributed Virtual Machines: A System Architecture for Network Computing. In Proceedings of the Eighth ACM SIGOPS European Workshop, September 1998.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Aldrich, J., Chambers, C., Sirer, E.G., Eggers, S. (1999). Static Analyses for Eliminating Unnecessary Synchronization from Java Programs. In: Cortesi, A., Filé, G. (eds) Static Analysis. SAS 1999. Lecture Notes in Computer Science, vol 1694. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-48294-6_2
Download citation
DOI: https://doi.org/10.1007/3-540-48294-6_2
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66459-8
Online ISBN: 978-3-540-48294-9
eBook Packages: Springer Book Archive