1 / 36

Tuning Garbage Collection in an Embedded Java Environment

Tuning Garbage Collection in an Embedded Java Environment. G. Chen, R. Shetty, M. Kandemir, N. Vijaykrishnan, M. J. Irwin Microsystems Design Lab The Pennsylvania State University. M. Wolczko Sun Microsystems, Inc. Objectives.

woody
Download Presentation

Tuning Garbage Collection in an Embedded Java Environment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tuning Garbage Collection in an Embedded Java Environment G. Chen, R. Shetty, M. Kandemir, N. Vijaykrishnan, M. J. Irwin Microsystems Design Lab The Pennsylvania State University M. Wolczko Sun Microsystems, Inc.

  2. Objectives • Investigate the role of GC in energy consumption of energy-aware systems • Find energy consumption improvements based on GC mechanism

  3. Roadmap • Background & Motivation • KVM GC and Parameters • Experiments setup • Energy Characterization and Optimization • Conclusions

  4. Why Java ? • Increasing popularity of Java in portable devices. • portability • natural for web based applications • Estimated number of Java enabled devices in 2005: 721 million • cell phones, PDAs, pagers etc.

  5. Characteristics of Embedded Devices • Small memory capacity • Requirements of low energy consumption • more (soft real-time, long duration sessions etc.) • How to incorporate the change ? • Application independent - by adapting JVM to target requirements

  6. Electrical Characteristics • Devices are required to reduce size and increase performance • Technological Solution: 10 Technology • Price: higher energy consumption

  7. Memory Energy Consumption • Significant part of overall energy consumption • Memory types: Banked-RAM, ROM, Cache • Characteristics: Dynamic, Leakage, Shutdown • Advances in miniaturization result in higher energy leakage

  8. Why GC ? • Independent of application, impacts memory management • May be easily controlled • May be used to shutdown memory banks

  9. KVM GC’S • Mark & Sweep (M&S) • Simple • M&S + Compaction (M&C) • Handles fragmentation • 2KB chunks reserved for ‘Permanent data’ not included in GC • Energy tradeoff: • Simple wastes more memory • complicated - consumes more

  10. More on M&C • Compaction occurs • No big enough entry in free list • When a need for more permanent memory arises • Until compaction - garbage-occupied memory is considered live 

  11. Memory Wasted Waiting for GC

  12. Experiment Setup - “Hardware” • microSparc-IIep embedded processor • 100Mhz, 32bit, 5-stage pipeline • On chip memories: ROM, RAM, Cache

  13. Experiment Energy Models • Simulate KVM executing applications • Accurately simulate hardware energy consumption • Cache modeled as SRAM • Scale parameters to 10  Technology • Assume large leakage-energy

  14. Experiment Setup - Banked Memory • Assume shutdown and turn-on capability of 16KB banks • Simulate Turn-on cost (350 cycles)

  15. Experiment Setup - Benchmarks

  16. Experiment Setup - Benchmarks

  17. Introducing Mode Control • Shutting down unused memory banks • Implemented on heap and stack • The price - the turning on / off process, is negligible

  18. Impact of Mode Control (M&S)

  19. Increasing Frequency of GC • Until garbage collection, memory banks might be on only storing garbage • Increasing GC Frequency will help get rid of the garbage more quickly • Tradeoff:Energy saved versus Energy spent on GC

  20. Controlling GC Frequency • In the experiment: “After K calls to the allocator” • In real implementation the policy should be f(memory allocated), or simply before turning on a new memory bank.

  21. Impact of GC Frequency Mode Control

  22. The Cost of Increasing GC Freq

  23. GC Frequency - Conclusions • Dependent on memory usage scheme • Don’t exaggerate ! • Frequency of ~70 gives good results • Application dependently determining the GC frequency could be an optimal(the article is already published...)

  24. Modifying Object Allocation Style • M&S algorithms maintain a ‘free list’ • More energy sensitive schemes: • Active Bank • free list per block • Allocate first from active banks • Active Bank+ • If cannot allocate from an already active bank - run GC

  25. Impact of Object Allocation Style Mode Control

  26. Impact of Object Allocation Style Explained • Active Bank ~ Mode Control • Coherent with observation that the younger die first • ‘Permanent’ objects occupy the lower part of heap. The higher part is usually cleaned during GC

  27. Impact of Object Allocation Style Explained • Active Bank + is better • Increases frequency of GC • reduces probability of turning on a new memory bank • Permanent objects are likely to be allocated more densely

  28. Compaction • Compaction may decrease number of active memory banks • Tradeoff:Energy spent on compaction versusreduction of memory energy consumption

  29. Impact of Default Compaction

  30. Impact of Default Compaction • Disappointing... • Better compaction schemes ? • M&C+ Perform compaction after each GC • M&C2 Different compaction algorithm • M&C2 versus M&C • cheaper marking and updating • more overhead per allocation

  31. Impact of Compaction Schemes

  32. Impact of Compaction - Conclusions • Compaction does not achieve great savings • Compaction though cannot be omitted • more memory will be needed for application due to fragmentation

  33. Impact of Cache • Reduces access to main memory: • Heap energy drops to 23% of overall energy • Cache itself is a significant energy consumer

  34. Impact of GC Schemes in Presence of Cache 15% 28%

  35. Conclusions • The combination of hardware mechanisms to lower energy leakage and software controlling it, may substantially reduce energy consumption • Saving may be achieved without application awareness

  36. Conclusions • GC mechanisms, with minor modifications, can help reach the energy saving goal • Mode Control, Allocation strategy, GC frequency are the most important. • Compaction is usually necessary, its implementation affects energy consumption

More Related