Runtime
Runtime is the period during which a computer program executes, as well as the software services and libraries, such as memory allocation, thread scheduling, and garbage collection, that support that execution.
What Is Runtime?
Runtime is the period during which a computer program is executing, as well as the collection of software services and libraries that support that execution. The term covers both a phase of the software lifecycle, distinct from compile time and link time, and a concrete system, often called a runtime system or runtime environment, that mediates between a running program and the underlying operating system and hardware. Runtime services include memory allocation, thread scheduling, exception handling, dynamic linking, input and output coordination, and, in managed languages, features such as garbage collection and just-in-time compilation.
A runtime sits at the boundary between a compiled artifact and the machine that ultimately runs it. For unmanaged languages like C, the runtime is small, chiefly the standard C library and process startup code. For managed platforms such as the Java Virtual Machine and the Common Language Runtime, the runtime is a substantial piece of system software in its own right, as described in the VMKit project documented in ACM SIGPLAN Notices.
Memory Management and Garbage Collection
Memory management is among the most consequential runtime responsibilities. A runtime allocates objects on the heap, tracks their lifetimes, and reclaims storage when it is no longer reachable. In managed environments, this is performed automatically by a garbage collector using strategies such as mark-and-sweep, generational collection, or concurrent tracing. The collector interacts with allocation paths, write barriers, and safepoints inserted by the compiler, so the runtime and the compiler are co-designed. Modern collectors target sub-millisecond pause times while sustaining high allocation throughput, a balance that depends on workload characteristics and heap sizing.
Execution Model and Just-in-Time Compilation
The execution model of a runtime determines how source or intermediate code is turned into instructions the processor can execute. Interpreted runtimes walk an abstract syntax tree or bytecode stream and dispatch operations one at a time. Compiled runtimes translate ahead of execution to native code. Many managed runtimes blend the two with just-in-time compilation, observing which methods and loops are hot and recompiling them with aggressive optimization during execution. Tiered compilation, inline caching, and profile-guided speculation are common techniques, described in performance work such as research compiled by the .NET performance team. The trade-off is startup latency against steady-state throughput.
Runtime Services and Libraries
Beyond compilation and memory, a runtime provides the services a program needs to interact with its host. These include thread creation and synchronization primitives, asynchronous I/O, dynamic symbol resolution, reflection, and exception propagation. Operating system abstractions such as file descriptors, network sockets, and timers are typically exposed through runtime-managed wrappers. Runtimes also enforce safety properties, including type checks, array bounds, and stack overflow detection, that protect the program from undefined behavior. Documentation for platforms like the Microsoft .NET runtime catalogs these services in its runtime libraries reference, showing the breadth of functionality that sits between application code and the kernel.
Applications
Runtime systems underpin nearly every domain of modern software, with specific variants tailored to different execution contexts, including:
- Enterprise application servers hosting Java and .NET workloads
- Web browsers executing JavaScript through engines such as V8 and SpiderMonkey
- Mobile platforms running Android applications on the ART runtime
- Scientific and numerical computing using Python and Julia runtimes
- Embedded and real-time systems with deterministic task schedulers
- Cloud-native containers and serverless functions with short-lived runtime instances