Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Managed Runtime Systems: Lecture 01 - Introduction

zakkak
January 17, 2018

Managed Runtime Systems: Lecture 01 - Introduction

zakkak

January 17, 2018
Tweet

More Decks by zakkak

Other Decks in Programming

Transcript

  1. Managed Runtime Systems Introduction Foivos Zakkak https://foivos.zakkak.net Except where otherwise

    noted, this presentation is licensed under the Creative Commons Attribution 4.0 International License. Third party marks and brands are the property of their respective holders.
  2. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 2 What is a Managed

    Runtime System? A machine that executes managed programs Managed Runtime System / Virtual Machine x86 ARMv8 RISC-V ... HW GNU/Linux OSX Windows ... OS Program (Java, Python, etc.)
  3. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 3 Other Names for Managed

    Runtime Systems ▪ Managed Runtime Systems ▪ Managed Runtimes ▪ Virtual Machines ▪ Process Virtual Machines ▪ Language Virtual Machines
  4. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 5 Why Managed Languages and

    Runtime Systems? 1. Portability 2. Safety 3. Productivity 4. Debugging 5. Performance 6. Snapshots
  5. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 6 Portability: “Write once, run

    anywhere” (aka WORA) ▪ Binary distribution ▪ Consistent behavior ▪ No need to recompile ▪ No need to account for OS differences ▪ No need to account for hardware differences
  6. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 7 Safety ▪ Sandboxed environment

    ▪ No pointer arithmetic ▪ No arbitrary memory accesses ▪ No arbitrary code flow
  7. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 8 Productivity ▪ Feature-full standard

    libraries (no need to reinvent the wheel) ▪ No need to account for OS differences ▪ No need to account for hardware differences/details
  8. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 9 Debugging ▪ No need

    to recompile ▪ On the fly instrumentation of production code ▪ Observation of system state
  9. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 13 How does it work?

    Interpreters Parse and execute instructions JIT compilers On the fly compilation to machine code Garbage Collectors Automatic memory management Memory Models Define expected behavior
  10. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 14 The most popular MRS/VMs

    Java  HotSpot  OpenJ9  Android Runtime JS  V8  SpiderMonkey  JavaScriptCore a.k.a. Nitro .Net (C#, J#, etc.)  Common Language Runtime a.k.a. CLR
  11. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 15 Different Goals – Different

    Challenges Java & .Net  Server Applications  Desktop Applications  Mobile Applications JS  Web Back-end (e.g. nodeJS)  Web Front-end  Desktop Applications (e.g. Electron)
  12. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 16 Server Applications Typical server

    applications: ▪ High throughput ▪ Low latency ▪ Large heap ▪ Responsiveness Micro-services: ▪ Fast startup ▪ Small heap ▪ Responsiveness
  13. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 18 Mobile Applications ▪ Responsiveness

    ▪ Fast startup ▪ Small memory footprint ▪ Low energy consumption
  14. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 21 Different Goals – Different

    Challenges Performance Orientation Memory Usage Energy Consumption Startup Time Desktop Apps Latency Medium Low Fast Mobile Apps Latency Low Low Fast Web Front-end Latency Low Low Fast Web Back-end Throughput High $ -- Server Apps Both High $ Fast for microservices
  15. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 23 Key features of a

    successful VM ▪ Fast ▪ Energy Efficient ▪ Secure ▪ Modular ▪ Built-in Concurrency Support
  16. Managed Runtime Systems CC-BY https://Foivos.Zakkak.net 24 Nice to have features

    ▪ Maintainable ▪ Polyglot!? ▪ Fault tolerant ▪ Support for accelerators/heterogeneous systems ▪ Small memory footprint