|
ABSTRACT
This paper describes a novel approach to reduce the memory consumption of Java programs, by focusing on their "string memory inefficiencies". In recent Java applications, string data occupies a large amount of the heap area. For example, about 40% of the live heap area is used for string data when a production J2EE application server is running. By investigating the string data in the live heap, we identified two types of memory inefficiencies -- "duplication" and "unused literals". In the heap, there are many string objects that have the same values. There also exist many string literals whose values are not actually used by the application. Since these inefficiencies exist as live objects, they cannot be eliminated by existing garbage collection techniques, which only remove dead objects. Quantitative analysis of Java heaps in real applications revealed that more than 50% of the string data in the live heap is wasted by these inefficiencies. To reduce the string memory inefficiencies, this paper proposes two techniques at the Java virtual machine level, "StringGC" for eliminating duplicated strings at the time of garbage collection, and "Lazy Body Creation" for delaying part of the literal instantiation until the literal's value is actually used. We also present an interesting technique at the Java program level, which we call "BundleConverter", for preventing unused message literals from being instantiated. Prototype implementations on a production Java virtual machine have achieved about 18% reduction of the live heap in the production application server. The proposed techniques could also reduce the live heap of standard Java benchmarks by 11.6% on average, without noticeable performance degradation.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
The Apache Software Foundation. Apache Harmony. http://harmony.apache.org/
|
| |
2
|
The Apache Software Foundation. Apache Tomcat. http://tomcat.apache.org/
|
| |
3
|
The Apache Software Foundation. Apache Tuscany. http://tuscany.apache.org/
|
| |
4
|
A. W. Appel and M. J. R. Goncalves. Hash-consing garbage collection. Technical Report CS-TR-412-93, Department of Computer Science, Princeton University, 1993.
|
| |
5
|
C. Bailey. Java Technology, IBM Style: Introduction to the IBM Developer Kit: An overview of the new functions and features in the IBM implementation of Java 5.0, 2006. http://www.ibm.com/developerworks/java/library/j-ibmjava1.html
|
 |
6
|
Stephen M. Blackburn , Robin Garner , Chris Hoffmann , Asjad M. Khang , Kathryn S. McKinley , Rotem Bentzur , Amer Diwan , Daniel Feinberg , Daniel Frampton , Samuel Z. Guyer , Martin Hirzel , Antony Hosking , Maria Jump , Han Lee , J. Eliot B. Moss , B. Moss , Aashish Phansalkar , Darko Stefanović , Thomas VanDrunen , Daniel von Dincklage , Ben Wiedermann, The DaCapo benchmarks: java benchmarking development and analysis, Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, October 22-26, 2006, Portland, Oregon, USA
|
| |
7
|
P. Chan, R. Lee, and D. Kramer. The Java Class Libraries, Second Edition, Addison Wesley, 1998.
|
| |
8
|
|
 |
9
|
|
| |
10
|
|
| |
11
|
E. Goto. Monocopy and Associative Algorithms in an Extended Lisp. Technical Report 74-03, Information Science Laboratory, University of Tokyo, 1974.
|
| |
12
|
Nikola Grcevski , Allan Kielstra , Kevin Stoodley , Mark Stoodley , Vijay Sundaresan, JavaTM just-in-time compiler and virtual machine improvements for server and middleware applications, Proceedings of the 3rd conference on Virtual Machine Research And Technology Symposium, p.12-12, May 06-07, 2004, San Jose, California
|
| |
13
|
IBM Corporation. IBM Trade Performance Benchmark. https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=trade6
|
| |
14
|
IBM Corporation. WebSphere Application Server. http://www.ibm.com/software/webservers/appserv/was/
|
| |
15
|
|
| |
16
|
S. P. Jones. Haskell 98 Language and Libraries: The Revised Report, Cambridge University Press, 2003.
|
 |
17
|
|
| |
18
|
K. Kawachiya, K. Ogata, and T. Onodera. A Quantitative Analysis of Space Waste from Java Strings and its Elimination at Garbage Collection Time. Research Report RT0750, IBM Tokyo Research Laboratory, 2007.
|
| |
19
|
|
 |
20
|
Darko Marinov , Robert O'Callahan, Object equality profiling, Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, October 26-30, 2003, Anaheim, California, USA
|
| |
21
|
N. Mitchell and G. Sevitsky. LeakBot: An Automated and Lightweight Tool for Diagnosing Memory Leaks in Large Java Applications. In Proceedings of the 17th European Conference on Object-Oriented Programming (ECOOP '03), pp. 351--377, 2003.
|
 |
22
|
|
| |
23
|
Open SOA. Service Component Architecture Home. http://osoa.org/display/Main/Service+Component+Architecture+Home
|
| |
24
|
Standard Performance Evaluation Corporation. SPEC JVM98 Benchmarks. http://www.spec.org/osg/jvm98/
|
| |
25
|
Sun Microsystems. Java2 Platform Standard Edition 5.0 API Specification: java.lang.String. http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html
|
| |
26
|
The Unicode Consortium. The Unicode Standard, Version 5.0, Addison Wesley, 2006.
|
| |
27
|
M. Vaziri, F. Tip, S. Fink, and J. Dolby. Declarative Object Identity Using Relation Types. In Proceedings of the 21st European Conference on Object-Oriented Programming (ECOOP '07), pp. 54--78, 2007.
|
|