Managed Runtime Systems

Introduction

The aim of this course is to introduce students to the world of managed runtime systems. Managed runtime systems are the ones responsible for executing managed programming languages, such as Python, Java, etc.

In this course we study how managed programming languages are implemented in the managed runtime systems. The course is mainly focused on the Java programming language and the Java Virtual Machine (JVM).

Syllabus

Lectures will take place every Wednesday and Thursday 10:00-12:00 at A.125, and tutorials will take place on Fridays 14:00-16:00 according to the schedule below.

Please note that the schedule is subject to change.

Week # Wednesday Thursday Friday Assignment
14/02/2022 1 Lecture (Course Intro & VMs Intro)
21/02/2022 2 Lecture (The JVM) Lecture (GC Intro)
28/02/2022 3 Lecture (JIT 1) Paper (Interpreters) <Project Proposal Deadline> Reading (Interpreters)
07/03/2022 4 Lecture (GC Intro 2) Paper (Call-site patching) Tutorial (Building/Editing OpenJDK and GraalVM) Reading (Call-site patching)
14/03/2022 5 Lecture (JIT 2) Paper (Deconstructing G1) Tutorial (G1) Reading (Deconstructing G1)
21/03/2022 6 Lecture (Metacircularity and Native Compilation) Paper (Maxine VM) <25th of March> Reading (Maxine VM)
28/03/2022 7 Lecture (Truffle) at B.106 Paper (GraalVM Native) Reading (GraalVM Native)
04/04/2022 8 Lecture (Java Concurrency & Concurrency) Paper (One VM to Rule Them All) Tutorial (JVM Anatomy Park) Reading (One VM to Rule Them All)
11/03/2022 9 Paper (Java Memory Model) Reading (Java Memory Model)
18/04/2022 - <Easter Break> <Easter Break> <Easter Break>
25/04/2022 - <Easter Break> <Easter Break> <Easter Break>
02/05/2022 10 Lecture (Advanced GC) Paper (Big Data GC) Reading (Big Data GC)
09/05/2022 11 Lecture (Performance) Paper (Performance) Reading (Performance)
16/05/2022 12 Paper (GC Performance Impact) Reading (GC Performance Impact)
23/05/2022 13 Project Presentations Project Presentations Project Presentations

Marking Scheme

Midterm 0%
Paper Presentation 20%
Paper Abstracts 15%
Final exam 0%
Project 50%
Class participation 15%

Contact

You can contact me directly via e-mail (foivos+cs446 |at| zakkak |dot| net) or through the course's mailing list 2022 |at| mrs-course.groups.io.

To subscribe send an email to: 2022+subscribe |at| mrs-course.groups.io or visit https://groups.io/g/mrs-course.

Material / Slides

The slides of the course are available as clickable links from the syllabus.

Acknowledgments

Guest lectures

  • 2019 – I kindly thank Dr. Heinz Kabutz for sharing his deep knowledge on Java threading and demoing how the JIT compiler can make Java programs behave in a "weird" way, while not breaking the Java Memory Model.
  • 2018 – I kindly thank Dr. Christos Kotselidis for his insightful presentation regarding "The Art of Java Performance" and the exciting live demo.

Inspiration and Material

  1. I would like to thank Mario Wolczko for sharing his material and experiences from a similar course he taught at UC Berkeley.

The original material of his course can be found here.

  1. I would like to thank Aleksey Shipilёv for the creation of the "JVM Anatomy Park" that provides a set of great examples and anecdotes to toy around in tutorials.

Projects

You can either work alone or form a team of two. For your project you can either focus on JIT compilation or Garbage Collection.

You shall choose and propose a project on your own. The project proposal should answer the following questions:

  1. What do you find interesting in the project?
  2. What do you expect to learn through this project implementation?
  3. How are you going to demonstrate the success of your project?

You are strongly encouraged to work on OpenJDK or Graal VM for your project, but projects on other VMs (even non-Java VMs) will be also accepted.

Projects will be developed on github and will be based on the latest release of the corresponding VM you will chose to work on.

Project Ideas / Past projects

  • See MMTk's open student projects and this tweet
  • Optimizations Performed by javac Identification of the optimizations performed by javac during compilation to bytecode. The team identified and located the javac's source code responsible for the various optimizations performed by javac and provided source code examples for each optimization that javac optimized.
  • Porting Maxine VM to Windows MaxineVM is not working on Windows. This project was about identifying what's needed to make MaxineVM work on Windows and implementing the missing parts. This project resulted in the following pull request on MaxineVM https://github.com/beehive-lab/Maxine-VM/pull/21
  • MaxineVM: Support for Trampolines on RISC-V This project was about porting MaxineVM's implementation of trampolines for ARM processors to RISC-V. This project results in the following pull request on MaxineVM https://github.com/beehive-lab/Maxine-VM/pull/19
  • Accelerating a Java FFT implementation on a GPU with TornadoVM The source codes of the two implementations are available at https://github.com/gkatev/TornadoFFT and https://gitlab.com/xvurakis/cs446
  • MaxineVM: Parallelization of the cross-ISA tests The source code of the implementation is available at https://github.com/Pyrromanis/maxine
  • Provide a Java API for an accelerated implementation of the Aho-Corasik algorithm The team provided the java API and evaluated against the standard pattern matching library provided by Java, and a Java implementation of Aho-Corasik.
  • Add support for SGX-backed encryption in MaxineVM The team successfully substituted the corresponding OpenJDK methods to provide SGX-backed encryption transparently to the developer/application. They also evaluated their implementation against vanilla MaxineVM and OpenJDK HotSpot. The source code used to be available at https://github.com/dkarnikis/niqqer_vm/
  • Testing MaxineVM with AdoptOpenJDK's test scripts This project aimed to use AdoptOpenJDK's test scripts to test MaxineVM. The team studied the scripts and the tests providing a description for each of them. They also modified the scripts to make them work with MaxineVM and provided an evaluation of MaxineVM with pass/fail results and comments.
  • A survey about Managed Runtime Systems in rust The team decided to enhance or try and implement (at least partially) a Javascript VM in rust. In their efforts they studied existing VMs and tried extending them
  • Hooking Maxine VM with External Disassembler MaxineVM comes with a built-in disassembler. This project aimed to hook MaxineVM with an external disassembler to make it easier to support more architectures without the need to extend the built-in disassembler.
  • Evaluation of MaxineVM in comparison to HotSpot The team used the DaCapo benchmark suite to evaluate MaxineVM and compare its performance to HotSpot.
  • Implementation of a Mark and Sweep Garbage Collector in a JS-like language
  • Extend Java concurrent lib with more concurrent data structures and evaluate them
  • Port MaxineVM to RISC-V The source code of the team's implementation is available at https://github.com/mvard/Maxine-VM
  • Identifying bottlenecks on MaxineVM
  • Evaluation of different Garbage Collectors
  • A memory manager implementation for C++ in C++
  • Evaluating the Performance of Interpreters Over Various Branch Predictors
  • Getting Familiar With Maxsim, A Simulation Platform For Managed Applications
  • Evaluation and comparison of Hotspot 1.7, Hotspot 1.8, MaxineVM, CACAO and JikesRVM

Project proposal deadline

Please submit your project proposals by 04/03/2022!

The earlier you submit the more time we will have to discuss and fine tune your proposal.

Reading Assignments

During this course you will be asked to read a number of scientific papers covering the topics at hand.

We will discuss each paper in the classroom to better understand them and answer any questions you might come up with. Each of you will prepare and deliver a presentation for one of those papers, while the rest will be assigned to deliver a short summary for each of the papers they do not present.

Summary format

Your summary should answer the following questions:

  1. What is the key point of the paper? (If it is the survey, what are the key techniques it presents?)
  2. What did you like the most in the paper?
  3. What could be improved in the presentation/content of the paper?
  4. Do you have any ideas on how to improve the presented idea/technique?
  5. On a scale of 0-5, with 5 being the most positive, how would you rate the paper?

Summary Submission

Please submit your summaries through email (in text or PDF format) by sending them to foivos+cs446summary |at| zakkak |dot| net. The email subject should follow the pattern [HY446] Summary: <Paper title>, e.g. [HY446] Summary: Garbage-First Garbage Collection. The summaries must be submitted before the beginning of the lecture where we will discuss the corresponding paper.