skip to main content
research-article

Shared heap management for memory-limited java virtual machines

Published:29 January 2008Publication History
Skip Abstract Section

Abstract

One scarce resource in embedded systems is memory. Multitasking makes the lack of memory problem even worse. Most current embedded systems, which do not provide virtual memory, simply divide physical memory and evenly assign contiguous memory chunks to multiple applications. Such simple memory management can frequently cause the lack of available memory for some applications, while others are not using the full amount of assigned memory. To overcome inefficiency in current memory management, we present an efficient heap management scheme that allows multiple applications to share heap space. To reduce overall heap memory usage, applications adaptively acquire subheaps out of shared pool of memory and release surplus subheaps to shared pool. As a result, applications see noncontiguous multiple subheaps as a heap in their address space. We target Java applications to implement our heap-sharing scheme in the KVM from Sun Microsystems. To protect fragmented heap space with a limited number of regions in memory protection unit (MPU), we maintain only a limited number of subheaps. We experimentally evaluate our heap management scheme with J2ME MIDP applications. Our static and dynamic schemes reduce heap memory usage, on average, by 30 and 27%, respectively. For both schemes, overheads are kept low. The execution times in our schemes are increased only by 0.01% for static scheme and 0.35% for dynamic scheme, on average.

References

  1. Chen, G., Shetty, R., Kandemir, M., Vijaykrishnan, N., Irwin, M. J., and Wolczko, M. 2002. Tuning garbage collection for reducing memory system energy in an embedded java environment. ACM Transactions on Embedded Computing Systems 1, 1, 27--55. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Choi, Y. and Han, H. 2006. Protected heap sharing for memory-constrained java environments. In Proceedings of the 2006 International Conference on Compilers, Architectures and Synthesis for Embedded Systems. 212--222. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Griffin, P., Srisa-an, W., and Chang, J. M. 2005. An energy efficient garbage collector for java embedded devices. In Proceedings of the 2005 ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems. 230--238. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Insight Software Solutions, Inc. MacroExpress® The Windows Automation Tool. Insight software solutions, Inc., http://www.macros.com.Google ScholarGoogle Scholar
  5. Johnes, R. and Lins, R. 1996. Garbage Collection: Algorithms for Automatic Dynamic Memory management. Wiley, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Knuth, D. E. 1997. The Art of Computer Programming Volume 1: Fundamental Algorithms. Second Edition. Addison-Wesley, Reading, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. midlet.org. Wireless Java Download. midlet.org, http://midlet.org.Google ScholarGoogle Scholar
  8. Minoraxis, Inc. Mobile games, BLOODY GHOST. Minoraxis, Inc., http://www.minoraxis.com/mobile.html.Google ScholarGoogle Scholar
  9. Shaham, R., Kolodner, E. K., and Sagiv, M. 2000. On the effectiveness of gc in java. In Proceedings of the 2nd International Symposium on Memory Management. 12--17. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Shaham, R., Kolodner, E. K., and Sagiv, M. 2001. Heap profiling for space-efficient java. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation. 104--113. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Sloss, A., Symes, D., and Wright, C. 2004. ARM System Developer's Guide. Morgan Kaufmann, San Francisco, CA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Sun Microsystems. 2002a. Connected, Limited Device Configuration (CLDC) 1.0.4. Sun Microsystems, http://java.sun.com/j2me.Google ScholarGoogle Scholar
  13. Sun Microsystems. 2002b. KVM Porting Guide, CLDC, Version 1.0.4, Java 2 Platform, Micro Edition. Sun Microsystems, Santa Clara, CA.Google ScholarGoogle Scholar
  14. Sun Microsystems. 2002c. Mobile Information Device Profile (MIDP) v2.0. Sun Microsystems, http://java.sun.com/j2me.Google ScholarGoogle Scholar
  15. Tual, J. 1999. Massc: A generic architecture for multiapplication smart cards. IEEE Micro 19, 5, 52--61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Wilson, P. R., Johnstone, M. S., Neely, M., and Boles, D. 1995. Dynamic storage allocation: A survey and critical review. In Proceedings of International Workshop on Memory Management. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Yang, T., Berger, E. D., Hertz, M. H., Kaplan, S. F., and Moss, J. E. B. 2004. Automatic heap sizing: Taking real memory into account. In Proceedings of the 4th International Symposium on Memory Management. 61--72. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Shared heap management for memory-limited java virtual machines

    Recommendations

    Reviews

    Andreas E. Schwald

    Multitasking in embedded systems without virtual memory is often done in a very simplistic way: by allocation of a fixed storage segment to a task. A more flexible strategy of heap allocation in a shared storage pool has to deal with the management of multiple fragmented heap areas, and the protection of these areas from undesirable accesses of other programs or tasks. The authors propose a two-level memory management scheme for "sharing and protecting fragmented heaps" to "reduce a considerable amount of memory footprint," with "almost no increase of execution time by carefully triggering garbage collection and live object compaction." The scheme relies on the capabilities of ARM processors (Sun Microsystems). The management of fragmented heap areas uses an adapted form of Kernel-based Virtual Machine (KVM) (portable Java Virtual Machine (JVM) for small, resource-constrained devices) and modified memory allocators/garbage collectors in JVMs. On the global level, subheaps (heap-area fragments) from a shared memory pool are allocated according to an address-ordered first-fit strategy. On the application level, a mark-sweep compact collector in one or more subheaps is used. This includes compaction across noncontiguous regions, and the release of surplus space to the global memory manager. For the selection of the sizes of heap areas, two strategies are discussed: deduction of subheap sizes from profiling information (available before program execution), and adaptive increasing/decreasing of sizes. Experimental results are given for several benchmark examples, showing significant reduction in memory footprints and a marginal increase in execution time. Experiments for other environments/platforms may confirm the value of this approach for heap-memory usage. The performance may largely depend on hardware features, operating system characteristics, and the garbage collection parameters. Though the discussion is rather informal, the paper contains useful information for people dealing with the intricacies of runtime systems for embedded applications. Online Computing Reviews Service

    Access critical reviews of Computing literature here

    Become a reviewer for Computing Reviews.

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!