Upload
nikolas-colson
View
215
Download
1
Embed Size (px)
Citation preview
1 © 1999 Citrix Systems Inc
CITRIX
Using type information ingarbage collection
Tim Harris
2 © 1999 Citrix Systems Inc
CITRIXTraditional heap organization
Reg
iste
rsSt
ack
Heap
3 © 1999 Citrix Systems Inc
CITRIXBaker’s treadmill collector
4 © 1999 Citrix Systems Inc
CITRIXProblem : reclamation is very bursty
Time
Hea
p si
ze
The whole heap has to be checked before any storage can be reclaimed.
5 © 1999 Citrix Systems Inc
CITRIXGenerational collection
Idea: separate newly created objects Evidence that they are likely to soon become garbage
Scan and reclaim space used by new objects without examining the entire heap How are references from old to new objects handled? When does an object become ‘old’?
How else could the heap be divided?
6 © 1999 Citrix Systems Inc
CITRIXAlternative : use type information
Reg
iste
rsSt
ack
7 © 1999 Citrix Systems Inc
CITRIXPotential benefits
Some storage can be reclaimed after each section of the heap has been scanned
Different sections can be scanned with different algorithms and maybe concurrently by different threads
Some sections can be scanned more frequently than others
8 © 1999 Citrix Systems Inc
CITRIXSegregating the heap - example 1
9 © 1999 Citrix Systems Inc
CITRIXSegregating the heap - example 2
10 © 1999 Citrix Systems Inc
CITRIXSegregating the heap - example 3
11 © 1999 Citrix Systems Inc
CITRIXImplementation
12 © 1999 Citrix Systems Inc
CITRIXResults - Delta Blue
13 © 1999 Citrix Systems Inc
CITRIXResults - Jar
14 © 1999 Citrix Systems Inc
CITRIXResults - Javac
15 © 1999 Citrix Systems Inc
CITRIXRemaining problems
Can new class definitions be handled efficiently at run-time?
Can the classes for non-trivial applications be effectively divided into these sections?
How is the success of the approach affected by different programming styles?
16 © 1999 Citrix Systems Inc
CITRIXNative-code compiler - original
17 © 1999 Citrix Systems Inc
CITRIXNative-code compiler - revised
18 © 1999 Citrix Systems Inc
CITRIXFuture work: parametric polymorphism
How are ‘generic’ references handled?
public class List
{
Object data;
List next;
}
public class List<T>
{
T data;
List next;
}