---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 25 Edition"
java_version: 25
chapter: "Chapter 6. The Java Virtual Machine Instruction Set"
section: "6.3"
heading: "6.3. Virtual Machine Errors"
parent: "Chapter 6. The Java Virtual Machine Instruction Set"
source: https://docs.oracle.com/javase/specs/jvms/se25/html/jvms-6.html#jvms-6.3
id: "6.3"
url: https://jvm.obfuscated.software/jvms/se25/6.3.html
raw: https://jvm.obfuscated.software/jvms/se25/6.3.md
---

# 6.3. Virtual Machine Errors

A Java Virtual Machine implementation throws an object that is an instance of a subclass of the class `VirtualMachineError` when an internal error or resource limitation prevents it from implementing the semantics described in this chapter. This specification cannot predict where internal errors or resource limitations may be encountered and does not mandate precisely when they can be reported. Thus, any of the `VirtualMachineError` subclasses defined below may be thrown at any time during the operation of the Java Virtual Machine:

- `InternalError`: An internal error has occurred in the Java Virtual Machine implementation because of a fault in the software implementing the virtual machine, a fault in the underlying host system software, or a fault in the hardware. This error is delivered asynchronously ([§2.10](2.10.md)) when it is detected and may occur at any point in a program.
- `OutOfMemoryError`: The Java Virtual Machine implementation has run out of either virtual or physical memory, and the automatic storage manager was unable to reclaim enough memory to satisfy an object creation request.
- `StackOverflowError`: The Java Virtual Machine implementation has run out of stack space for a thread, typically because the thread is doing an unbounded number of recursive invocations as a result of a fault in the executing program.
- `UnknownError`: An exception or error has occurred, but the Java Virtual Machine implementation is unable to report the actual exception or error.
