01.12.2012 Views

Architecture of Computing Systems (Lecture Notes in Computer ...

Architecture of Computing Systems (Lecture Notes in Computer ...

Architecture of Computing Systems (Lecture Notes in Computer ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

30 T.B. Preußer, P. Reichel, and R.G. Spallek<br />

The classical compaction approaches are two-space copy<strong>in</strong>g [17] and markand-compact,<br />

which is used by JOP’s hardware-assisted GC [12]. We, <strong>in</strong>stead,<br />

propose a novel mark-and-copy approach operat<strong>in</strong>g on a segmented memory.<br />

This approach avoids both the tremendous space overhead <strong>of</strong> two-space copy<strong>in</strong>g<br />

as well as the compaction race <strong>of</strong> a concurrent mark-and-compact where<br />

each allocation shr<strong>in</strong>ks the allocation area while also add<strong>in</strong>g to the compaction<br />

work.<br />

The segment life cycle depicted <strong>in</strong> Fig. 3 is managed by the MCU. Designated<br />

hardware modules assist the allocation and the compaction and operate on segments<br />

assigned by the MCU. The time-critical allocation is, thus, fully decoupled<br />

from the MCU, and even the exchange <strong>of</strong> the allocation segment is buffered by<br />

FIFOs. The compaction process, on the other hand, is mostly controlled by the<br />

MCU itself. Merely, the object movement is implemented as hardware service<br />

provided by the memory access management. This low-level <strong>in</strong>tegration enables<br />

transparent mutator access even to objects be<strong>in</strong>g copied.<br />

The MCU regularly <strong>in</strong>itiates heap scans to detect dead objects. While their<br />

references handles are recycled immediately, their occupied memory is only<br />

marked as such. Segment utilization statistics are ma<strong>in</strong>ta<strong>in</strong>ed to identify sparsely<br />

used segments whose surviv<strong>in</strong>g objects are evacuated <strong>in</strong>to an evacuation segment<br />

before the segment is returned to the pool <strong>of</strong> empty ones. Similar to the allocation<br />

segment, the evacuation segment is populated compactly us<strong>in</strong>g bump-po<strong>in</strong>ter allocation<br />

and is only exchanged upon the first unsuccessful migration.<br />

This proposed algorithm enables cont<strong>in</strong>uous allocation and concurrent garbage<br />

collection. A race between allocation and collection has been avoided as<br />

both are operat<strong>in</strong>g <strong>in</strong> dist<strong>in</strong>ct segments. The copy<strong>in</strong>g effort is reduced to surviv<strong>in</strong>g<br />

objects co-resid<strong>in</strong>g with garbage <strong>in</strong> the same segment. Segments with<br />

only short-lived operational objects are freed as a whole without any copy<strong>in</strong>g<br />

work. Segments with accumulated old long-lived objects will rema<strong>in</strong> untouched.<br />

In addition to the spontaneous formation <strong>of</strong> object generations, the collector can<br />

accelerate this trend by the use <strong>of</strong> generational evacuation segments.<br />

The critical parameter <strong>of</strong> the proposed approach is the segment size. Firstly,<br />

it restricts the size <strong>of</strong> the largest allocatable object. Secondly, small segments<br />

<strong>in</strong>crease the management overhead <strong>in</strong> terms <strong>of</strong> segment exchanges and state<br />

<strong>in</strong>formation. On the other hand, large segments force a coarse-gra<strong>in</strong> memory<br />

management with a potentially significant space overhead approach<strong>in</strong>g the behavior<br />

<strong>of</strong> a copy<strong>in</strong>g collector. Hence, a set <strong>of</strong> well over 4 segments should be, at<br />

least, available.<br />

Hav<strong>in</strong>g decided for a mov<strong>in</strong>g GC, measures must be taken to ensure the stable<br />

identification <strong>of</strong> each object throughout its life cycle even <strong>in</strong> the possibility <strong>of</strong> its<br />

displacement. This is achieved through fully-transparent handles, which are the<br />

only identifications <strong>of</strong> objects ever known to a mutator. The memory manager<br />

<strong>in</strong>ternally maps a handle to a state record compris<strong>in</strong>g the current storage location<br />

<strong>of</strong> the referenced object, the sizes <strong>of</strong> its reference and data areas as well as some<br />

GC <strong>in</strong>formation.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!