|
|
|
@ -1,11 +1,15 @@
|
|
|
|
|
\chapter{Garbage collection}
|
|
|
|
|
\label{chap-garbage-collection}
|
|
|
|
|
|
|
|
|
|
\section{Introduction}
|
|
|
|
|
|
|
|
|
|
Contrary to traditional operating systems such as \unix{}, a Lisp
|
|
|
|
|
operating system will need a global \emph{garbage collector}. There
|
|
|
|
|
is a rich literature (see e.g., \cite{Jones:2011:GCH:2025255}) on the
|
|
|
|
|
subject.
|
|
|
|
|
|
|
|
|
|
\section{Per-thread garbage collector}
|
|
|
|
|
|
|
|
|
|
Each thread has a local heap, roughly the size of the cache, say
|
|
|
|
|
around 4MiB. The thread-local heap is managed entirely by the thread
|
|
|
|
|
itself, so that the garbage collector for it is executed by the thread
|
|
|
|
@ -16,6 +20,8 @@ maintain allocation order. This way, we have a precise measure of the
|
|
|
|
|
relative age of the objects, so that we can promote only the oldest
|
|
|
|
|
objects when required.
|
|
|
|
|
|
|
|
|
|
\section{Global garbage collector}
|
|
|
|
|
|
|
|
|
|
In addition to the thread-local heaps, there is a global heap. The
|
|
|
|
|
garbage collector for this heap will use a combination of the
|
|
|
|
|
traditional \emph{mark-and-sweep} collector and an ordinary memory
|
|
|
|
|