A non-moving collector Organization of heap memory in GC Heap - - PowerPoint PPT Presentation

a non moving collector organization of heap memory in gc
SMART_READER_LITE
LIVE PREVIEW

A non-moving collector Organization of heap memory in GC Heap - - PowerPoint PPT Presentation

A non-moving collector Organization of heap memory in GC Heap memory falls in 4 sets in a GC world Scanned objects Visited but unscanned objects Objects not yet visited Free space Semi-space copying collector attempts to


slide-1
SLIDE 1

A non-moving collector

slide-2
SLIDE 2

Organization of heap memory in GC

 Heap memory falls in 4 sets in a GC world

 Scanned objects  Visited but unscanned objects  Objects not yet visited  Free space

 Semi-space copying collector attempts to implement

these spaces

 Baker’s treadmill collector offers another arrangement

  • f these sets in a non-moving collector

2

slide-3
SLIDE 3

Advantages of non-moving collector

 Better suited for uncooperative environments  Mutator does not need to be protected from changes

made by collector

 Collector does not move objects

 NB: asynchronous movement may be disruptive to

compiler optimization

3

slide-4
SLIDE 4

Baker’s treadmill

4

Jones and Lin: Diagram 8.15

slide-5
SLIDE 5

Organization of Baker’s Treadmill

 All objects organized into cyclic doubly-linked list

 Hence the name treadmill

 Each color segment in the list is arranged contiguously  Fourth color, off-white used for free list  The four segments delimited by four pointers

 free  B  T  Scan

 Similar to his incremental copying collector (see next slide)

5

slide-6
SLIDE 6

Best known read-barrier collector

6 Tospace T B scan

new allocations copied

  • bjects

top bottom

 Allocation occurs at top of to_space

to_space

slide-7
SLIDE 7

Operation of Treadmill collector

 How is allocation done?  What about marking? How is it done?  No manipulation of color bits is necessary. Why?  If scanned pointer refers to a black or grey object no

action is required

 If object is white, what actions must be taken?

7

slide-8
SLIDE 8

Effects of snapping

 Snapping is a constant time operation

 Offers algorithm potential to meet real-time bounds

 Only point at which color needs to be discriminated

 Is object white or not

 If object is snapped at T end of grey segment

 Traversal is breadth-first  More page faults

 If object is snapped at scan end of grey segment

 Traversal is depth-first  No auxiliary stack needed

8

slide-9
SLIDE 9

More on algorithm

 GC cycle is complete when no grey cells are left

 When scan pointer meets T pointer

 Flip when free pointer meets B pointer

 Only two colors at this point: black and white  Black segment  white  White segment  off-white  B and T pointers are exchanged  Treadmill advances its segments

9

slide-10
SLIDE 10

Cost of treadmill algorithm

 Expensive with regards to space compared with non-

moving collectors

 Space overhead for Links

 Memory utilization no more than copying collector  Allocation more expensive than bumping a pointer  Has problems with handling variable size objects  Uses read-barrier to synchronize collector with

mutator

 Read-barriers are expensive

10

slide-11
SLIDE 11

Hardware support for real-time GC

 No software GC has yet to demonstrate convincing

hard real-time performance

 Read-barrier techniques expensive  Write-barrier techniques vary in the face of virtual

memory

 Nilsen and Schmidt argue that hard real-time systems

must have hardware support

11

slide-12
SLIDE 12

Nilsen’s hardware architecture

12

Jones and Lin: Diagram 8.15

slide-13
SLIDE 13

Motivation for Nilsen’s architecture

 General purpose computers, besides supercomputers ,

that rely on specialized hardware have not had commercial success

 Nilsen isolates GC hardware in a special memory

module that interfaces with the CPU through memory bus

 Rational: technology investment will be shared

between different processor architecture

13