1
OntheUsefulnessofLiveness forGarbageCollection andLeakDetection
MartinHirzel,AmerDiwan,and AntonyHosking
{hirzel,diwan}@cs.colorado.eduhosking@cs.purdue.edu
OntheUsefulnessofLiveness forGarbageCollection andLeakDetection - - PowerPoint PPT Presentation
OntheUsefulnessofLiveness forGarbageCollection andLeakDetection MartinHirzel,AmerDiwan,and AntonyHosking {hirzel,diwan}@cs.colorado.eduhosking@cs.purdue.edu
1
{hirzel,diwan}@cs.colorado.eduhosking@cs.purdue.edu
2
3
Unreachable
4
Unreachable
5
Unreachable
6
Unreachable
7
8
conservative partial full none weak strong Type Accuracy Liveness Accuracy investigatedinliterature unexplored
9
conservative partial full none weak strong Type Accuracy Liveness Accuracy investigatedinliterature unexplored
10
11
12
CorEiffel program Instrument Analysis library Link Run-1 Liveness analysis Link Run-2 Trace Stubs+ BDWgc TypeInformation LivenessInformation Accuracy selection
13
CorEiffel program Instrument Type-analysis library Link Run-1 Liveness analysis Link Run-2 Trace Stubs+ BDWgc TypeInformation LivenessInformation Accuracy selection
14
x= malloc(4*N); note_allocation(); note_assign(&x); i=0; note_assign(&i); while(i<N){ y=x+4*i; note_assign(&y,&x,&i); *y=i; note_use(&y); note_assign(y,&i); i++; note_assign(&i,&i); } x=malloc(4*N); i=0; while(i<N){ y=x+4*i; *y=i; i++; }
… allocation(91) assign(x) assign(i) assign(y,x,i) use(y) assign(91.0,i) assign(i,i) assign(y,x,i) use(y) assign(91.4,i) …
15
… allocation(91) assign(x) assign(i) assign(y,x,i) use(y) assign(91.0,i) assign(i,i) assign(y,x,i) use(y) assign(91.4,i) …
x y i
T1:{x,i} T2:{} T1:{x,i}
“Avariableislive ifitsvaluewillbeusedinthefuture.”
16
Conservative
Bytes reachable Time Accurate Reachabilitytraversal:123 Reachability reduction:10%20%0%
17
18
Spec95 9030872 7597 C li Spec95 GNU Austin Austin Austin Austin Austin Bezault Hillion Durian Hirzel Bartlett Bartlett Author/Source 148664 14180 12382400 41380 166832 7920 259512 106392 109548 222300 28700 1123180 2200004 Totalallocation[Bytes] Language LinesofCode Name 31211 8163 7308 3979 2156 782 647 17185 3137 927 350 196 85 C ijpeg C gzip C bc C yacr2 C ft C ks C anagram Programswithexplicitdeallocation: Eiffel gegrep Eiffel ebignum Eiffel erbt Eiffel bshift C gctest C gctest3 ProgramswrittenwithGCinmind:
19
10 20 30 40 50 60
% Bytes
g c t e s t 3 g c t e s t b s h i f t e r b t e b i g n u m l i g e g r e p a n a g r a m k s f t y a c r 2 b c g z i p i j p e g
average atpeak
20
10 20 30 40 50 60
% Bytes
g c t e s t 3 g c t e s t b s h i f t e r b t e b i g n u m l i g e g r e p a n a g r a m k s f t y a c r 2 b c g z i p i j p e g
average atpeak
79 94 98 87 2 98 90 98 50 20
% s traversal Num different
21
10 20 30 40 50 60 % Bytes
g c t e s t 3 b s h i f t e r b t e b i g n u m l i g e g r e p y a c r 2 b c g z i p i j p e g
stack intrascalars s.+glob interall s.+glob interscalars s.+glob intrascalars stack interall stack inter scalars
22
10 20 30 40 50 60 % Bytes gctest3 bshift erbt ebignum li gegrep yacr2 bc gzip ijpeg
Type(Pentium ) Liveness Type+Liveness
23
Global Stack Benchmark 2.2 0.0 0.0 %different 1.3 2.7 0.7 %different gzip yacr2 gegrep
24
25
26