13-GC-Runtime - CS 421 Lecture 13 Run-time systems and...

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 421 Lecture 13: Run-time systems and garbage collection square4 Lecture outline square4 Execution of dynamic languages square4 Sun HotSpot run-time system for Java square4 Tags, JIT compilation, reflection square4 Memory management square4 Memory layout; definition of “garbage” square4 Reference-counting square4 Garbage collection square4 Non-compacting (mark-and-sweep) square4 Compacting 6/29/2009 1
Image of page 1

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

View Full Document Right Arrow Icon
Dynamic languages square4 Automatic memory management square4 Tagged values square4 For GC, run-time type-checking, reflection square4 Sometimes: square4 Dynamic type-checking square4 Reflection square4 Usually: square4 Execute virtual machine code square4 Will use Sun HotSpot Java virtual machine as example 6/29/2009 2
Image of page 2
Java HotSpot run-time system square4 Developed around 1999 – replaced existing widely-used Java VM square4 Described in several places, e.g. : http://java.sun.com/products/hotspot/whitepaper.html square4 HotSpot is VM used in java program, and embedded in many browsers (Note re: above document – word “compiler” used to refer to translator from Java bytecode to native machine code, not translator from source code.) 6/29/2009 3
Image of page 3

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

View Full Document Right Arrow Icon
Java HotSpot run-time system square4 Garbage collection square4 Two-word object headers square4 Executes .class files (Java VM code) square4 “Just-in-time” compilation square4 Meta-objects represented as objects 6/29/2009 4
Image of page 4
Meta-objects represented as objects square4 Class and Method are classes square4 Each class corresponds to a Class object square4 Methods of class Class include getDeclaredMethods(), getFields(), … square4 Each method corresponds to a Method object square4 Methods of class Method include getParameterTypes, getReturnType, … square4 Can invoke methods that are detected dynamically – e.g. , search all objects reachable from one object – and invoke method print on any object whose class contains a print method. 6/29/2009 5
Image of page 5

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

View Full Document Right Arrow Icon
Two-word headers square4 Every object in heap is preceded by two words square4 First word is pointer to Class object of this method’s class (which gives layout of object) square4 Second word contains GC info square4 Arrays contain third word giving length 6/29/2009 6
Image of page 6
Just-in-time compilation square4 Methods obtained in bytecode form (.class files) translated to native machine code on the fly square4 Numerous optimizations employed square4 Very important optimization: inlining square4 Level of optimization determined by monitoring execution
Image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern