open class OutOfMemoryError : VirtualMachineError
Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector. OutOfMemoryError objects may be constructed by the virtual machine as if suppression were disabled and/or the stack trace was not.
Summary
| Public constructors |
|
Constructs an OutOfMemoryError with no detail message.
|
|
Constructs an OutOfMemoryError with the specified detail message.
|
Public constructors
OutOfMemoryError
OutOfMemoryError()
Constructs an OutOfMemoryError with no detail message.
OutOfMemoryError
OutOfMemoryError(s: String!)
Constructs an OutOfMemoryError with the specified detail message.
| Parameters |
s |
String!: the detail message. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-02-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-02-13 UTC."],[],[]]