Increasing Memory Usage in RealTime GC - PowerPoint PPT Presentation

About This Presentation
Title:

Increasing Memory Usage in RealTime GC

Description:

Published 'real' real-time garbage collectors consume too ... Peep hole optimization. Stack allocation. Object owning (Data flow analysis) 15. 7-9 October, 2002 ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 20
Provided by: tobias54
Category:

less

Transcript and Presenter's Notes

Title: Increasing Memory Usage in RealTime GC


1
Increasing Memory Usage inReal-Time GC
  • Tobias Ritzau and Peter Fritzson
  • Department of Computer and Information Science
  • Linköpings universitet
  • tobri_at_ida.liu.se
  • http//www.ida.liu.se/tobri

2
The Problem
  • Published real real-time garbage collectors
    consume too much memory
  • A large portion of the overhead is caused by type
    information, internal fragmentation, and GC house
    keeping
  • However, most GC techniques also require a buffer
    to hold dead objects

3
Mark-Sweep
Root
4
Buffer for Dead Objects
5
Buffer for Dead Objects
6
RT-Copying
7
RT-Mark-Sweep (JamaicaVM)
8
Available Memory
  • The amount of available memory using real-time
    garbage collection and a heap of 12 36 byte
    objects (equally distributed) is
  • Copying GC 25
  • Mark-Sweep (JamaicaVM) 31
  • Reference Counting 47

9
Reference Counting
1
2
1
1
0
1
1
0
2
1
0
2
1
1
0
Root
10
Reference Counting
  • Disadvantages to overcome
  • Recursive freeing
  • External fragmentation
  • Reclaiming dead cyclic data structures
  • Execution speed

11
Recursive Freeing
  • The problem was solved for equally sized objects
    by Weizenbaum (1963)
  • Decrementing child references is postponed until
    the memory is reused
  • Still, all memory is available when it becomes
    unreachable
  • However, objects are not always of the same size

12
External Fragmentation
  • As in most file systems, the heap can be divided
    into equally sized blocks
  • Small objects are linked using a list, while
    larger objects use a tree structure
  • Minor performance penalty for small objects
  • Weizenbaums technique to eliminate recursive
    freeing can be used on the blocks

13
Dead Cyclic Data Structures
  • Manual techniques cover most cases
  • Breaking cycles
  • Weak references
  • Balloon types
  • Automatic techniques are not real-time
  • A backup real-time mark-sweep GC can be used but
    that increases memory overhead

14
Execution Time
  • Peep hole optimization
  • Stack allocation
  • Object owning (Data flow analysis)

15
RT-Reference Counting
  • All operations are predictable in memory usage
    and execution time
  • Memory usage is increased by more than 50 for
    objects larger than 17 bytes
  • Dead cyclic data structures can be reclaimed (to
    the cost of memory overhead)

16
Impact of Block Size
17
Impact of Block Size
The diagrams show the overhead of the block
header, the object header, and the internal
fragmentation of a real-time reference counter
using 16, 32, and 64 byte blocks
16
Fragmentation
Object
Block
32
64
18
Execution Time Comparison
S object size O memory overhead for dead
objects
19
Implementations
  • Real-Time Reference Counting has been
    implemented
  • As CPP macros
  • In the JOSES Java compiler
  • In the Jamaica VM
  • However more optimizations are required
  • No backup GC has been implemented

20
Benchmarks
b dividing objects into blocks bs spreading
the blocks r using reference counting t
running thousand simulations ( more blocks in
use)
21
Future Work
  • Full implementation
  • RT-Mark compact
  • Memory Usage Analysis
  • Should critical systems use GC?
  • Can you not explicitly deallocate all garbage if
    you can give an upper bound of memory usage?

22
Conclusion
  • RT-Reference Counting drastically decrease the
    memory overhead of real-time systems with a GC
  • The block size have a minor impact on the memory
    overhead

23
Increasing Memory Usage in Real-Time GC
  • Tobias Ritzau and Peter Fritzson
  • Department of Computer and Information Science
  • Linköpings universitet
  • tobri_at_ida.liu.se
  • http//www.ida.liu.se/tobri
Write a Comment
User Comments (0)
About PowerShow.com