17 - 380C Lecture17 Wherearewe&wherewearegoing...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
380C Lecture 17 Where are we & where we are going Managed languages Dynamic compilation Inlining Garbage collection Why you need to care about workloads &  experimental methodology Alias analysis Dependence analysis Loop transformations EDGE architectures 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Today Garbage Collection Why use garbage collection? What is garbage? Reachable vs live, stack maps, etc. Allocators and their collection mechanisms Semispace Marksweep Performance comparisons Incremental age based collection Write barriers: Friend or foe? Generational  Beltway More performance
Background image of page 2
3 Basic VM Structure Executing Program Program/Bytecode Dynamic Compilation Subsystem Class Loader Verifier, etc. Heap Thread Scheduler Garbage Collector
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 True or False? Real programmers use languages with explicit memory  management. I can optimize my memory management much better than any  garbage collector 
Background image of page 4
5 True or False? Real programmers use languages with explicit memory  management. I can optimize my memory management much better than any  garbage collector  Scope of effort?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Why Use Garbage Collection? Software engineering benefits Less user code compared to explict memory management (MM) Less user code to get correct Protects against some classes of memory errors No free(), thus  no premature free(), no double free(), or forgetting to free() Not perfect, memory can still leak Programmers still need to eliminate all pointers to objects the program no longer needs  Performance: space time tradeoff Time proportional to dead objects (explicit mm, reference counting) or live objects  (semispace, marksweep) Throughput versus pause time Less frequent collection, typically reduces total time but increases space requirements and  pause times Hidden locality benefits?
Background image of page 6
7 What is Garbage? In theory, any object the program will never reference again But compiler & runtime system cannot figure that out In practice, any object the program cannot reach is garbage Approximate liveness with reachability Managed languages couple GC with “safe” pointers Programs may not access arbitrary addresses in memory The compiler can identify and provide to the garbage collector all the  pointers, thus “Once garbage, always garbage”  Runtime system can move objects by updating pointers “Unsafe” languages can do non-moving GC by assuming anything that looks  like a pointer is one.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Reachability stack globals registers heap A B C {       . ...         r0 = obj PC -> p.f  = obj          . ...
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 94

17 - 380C Lecture17 Wherearewe&wherewearegoing...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online