Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added normative text & xrefs

A Java OutofMemoryError occurs if the program attempts to use more heap space than what is available. Among other causes, this error may result from

Some of these causes are platform-dependent, and difficult to anticipate. Others are fairly easy to anticipate, such as reading data from a file. Therefore, programs shall not accept untrusted input in a manner that can cause the program to exhaust memory.

Noncompliant Code Example (readLine())

...