java.lang · java.base · since Java 1.0
Runtime
public class RuntimeThe JVM's runtime handle: processor count, memory figures, shutdown hooks, and process spawning (prefer ProcessBuilder).
Key methods
static Runtime getRuntime() | The singleton. |
int availableProcessors() | CPUs visible to the JVM — container-quota-aware; sizes thread pools. |
long maxMemory() / totalMemory() / freeMemory() | Heap ceiling / currently committed / free within committed. |
void addShutdownHook(Thread hook) | Cleanup on JVM exit (not on kill -9). |