Download presentation
Presentation is loading. Please wait.
Published byAubrey Irene Bailey Modified over 9 years ago
1
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
2 Objectives b Investigate the role of GC in energy consumption of energy-aware systems b Find energy consumption improvements based on GC mechanism
3
3 Roadmap b Background & Motivation b KVM GC and Parameters b Experiments setup b Energy Characterization and Optimization b Conclusions
4
4 Why Java ? b Increasing popularity of Java in portable devices. portability natural for web based applications b Estimated number of Java enabled devices in 2005: 721 million cell phones, PDAs, pagers etc.
5
5 Characteristics of Embedded Devices b Small memory capacity b Requirements of low energy consumption b more (soft real-time, long duration sessions etc.) b How to incorporate the change ? b Application independent - by adapting JVM to target requirements
6
6 Electrical Characteristics b Devices are required to reduce size and increase performance b Technological Solution: 10 Technology b Price: higher energy consumption
7
7 Memory Energy Consumption b Significant part of overall energy consumption b Memory types: Banked-RAM, ROM, Cache b Characteristics: Dynamic, Leakage, Shutdown b Advances in miniaturization result in higher energy leakage
8
8 Why GC ? b Independent of application, impacts memory management b May be easily controlled b May be used to shutdown memory banks
9
9 KVM GC’S b Mark & Sweep (M&S) Simple b M&S + Compaction (M&C) Handles fragmentation 2KB chunks reserved for ‘Permanent data’ not included in GC b Energy tradeoff: Simple wastes more memory complicated - consumes more
10
10 More on M&C b Compaction occurs No big enough entry in free list When a need for more permanent memory arises b Until compaction - garbage-occupied memory is considered live
11
11 Memory Wasted Waiting for GC
12
12 Experiment Setup - “Hardware” b microSparc-IIep embedded processor b 100Mhz, 32bit, 5-stage pipeline b On chip memories: ROM, RAM, Cache
13
13 Experiment Energy Models b Simulate KVM executing applications b Accurately simulate hardware energy consumption b Cache modeled as SRAM b Scale parameters to 10 Technology b Assume large leakage-energy
14
14 Experiment Setup - Banked Memory b Assume shutdown and turn-on capability of 16KB banks b Simulate Turn-on cost (350 cycles)
15
15 Experiment Setup - Benchmarks
16
16 Experiment Setup - Benchmarks
17
17 Introducing Mode Control b Shutting down unused memory banks b Implemented on heap and stack b The price - the turning on / off process, is negligible
18
18 Impact of Mode Control (M&S)
19
19 Increasing Frequency of GC b Until garbage collection, memory banks might be on only storing garbage b Increasing GC Frequency will help get rid of the garbage more quickly b Tradeoff: Energy saved versus Energy spent on GC
20
20 Controlling GC Frequency b In the experiment: “After K calls to the allocator” b In real implementation the policy should be f(memory allocated), or simply before turning on a new memory bank.
21
21 Impact of GC Frequency Mode Control
22
22 The Cost of Increasing GC Freq
23
23 GC Frequency - Conclusions b Dependent on memory usage scheme b Don’t exaggerate ! b Frequency of ~70 gives good results b Application dependently determining the GC frequency could be an optimal (the article is already published...)
24
24 Modifying Object Allocation Style b M&S algorithms maintain a ‘free list’ b More energy sensitive schemes: b Active Bank free list per block Allocate first from active banks b Active Bank+ If cannot allocate from an already active bank - run GC
25
25 Impact of Object Allocation Style Mode Control
26
26 Impact of Object Allocation Style Explained b 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
27 Impact of Object Allocation Style Explained b 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
28 Compaction b Compaction may decrease number of active memory banks b Tradeoff: Energy spent on compaction versus reduction of memory energy consumption
29
29 Impact of Default Compaction
30
30 Impact of Default Compaction b Disappointing... b Better compaction schemes ? M&C+ Perform compaction after each GC M&C2 Different compaction algorithm b M&C2 versus M&C cheaper marking and updating more overhead per allocation
31
31 Impact of Compaction Schemes
32
32 Impact of Compaction - Conclusions b Compaction does not achieve great savings b Compaction though cannot be omitted more memory will be needed for application due to fragmentation
33
33 Impact of Cache b Reduces access to main memory: Heap energy drops to 23% of overall energy b Cache itself is a significant energy consumer
34
34 Impact of GC Schemes in Presence of Cache 15% 28%
35
35 Conclusions b The combination of hardware mechanisms to lower energy leakage and software controlling it, may substantially reduce energy consumption b Saving may be achieved without application awareness
36
36 Conclusions b GC mechanisms, with minor modifications, can help reach the energy saving goal b Mode Control, Allocation strategy, GC frequency are the most important. b Compaction is usually necessary, its implementation affects energy consumption
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.