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
- a memory leak. See MSC06MSC05-J. Avoid memory leaks for information on preventing memory leaks.
- an infinite loop
- limited amounts of default heap memory available
- incorrect implementation of common data structures (hash tables, vectors and so on)
- unbound deserialization.
- writing a large number of objects to an
ObjectOutputStream
. For more information, see SER10-J. Avoid memory and resource leaks during serialization. - creating a large number of threads
- uncompressing a file. See IDS05-J. Limit the size of files passed to ZipInputStream for example.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c036267bc67c113a-09f1a08e-4f3b4a13-8de28061-cf1067b29ad5279167c1750d"><ac:plain-text-body><![CDATA[ | [[MITRE 2009 | AA. Bibliography#MITRE 09]] | [CWE-400 | http://cwe.mitre.org/data/definitions/400.html] "Uncontrolled Resource Consumption ('Resource Exhaustion')" | ]]></ac:plain-text-body></ac:structured-macro> |
| CWE-770 "Allocation of Resources Without Limits or Throttling" |
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="d81412934a2a1b46-89aa1f5b-4523416c-b8e69897-e51d31a7fcb0be66724104a5"><ac:plain-text-body><![CDATA[ | [[Sun 2006 | AA. Bibliography#Sun 06]] | [Garbage Collection Ergonomics | http://java.sun.com/javase/6/docs/technotes/guides/vm/gc-ergonomics.html ], "Default values for the Initial and Maximum heap size" | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="920ec276aeeeb8b8-bd722fe4-448d48cb-b6449fe9-aca5d1937997659d254918c1"><ac:plain-text-body><![CDATA[ | [[Java 2006 | AA. Bibliography#Java 06]] | [java - the Java application launcher | http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html ], "Syntax for increasing the heap size" | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="269536b444012ea9-5d74b591-49ae4184-afb8afab-a546f29fc3ba3fd0a106f8ad"><ac:plain-text-body><![CDATA[ | [[Sun 2003 | AA. Bibliography#Sun 03]] | Chapter 5: Tuning the Java Runtime System, [Tuning the Java Heap | http://docs.sun.com/source/817-2180-10/pt_chap5.html#wp57027] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1918f3758bc6cf69-72d2dbf8-41234ef5-b0b685d2-293ba478683bd4fb219b62a6"><ac:plain-text-body><![CDATA[ | [[API 2006 | AA. Bibliography#API 06]] | Class ObjectInputStream and ObjectOutputStream | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="70edbd8cf91ddf96-23734632-4e7e4eac-877aab04-902567d7d10ccc2ba3c01d85"><ac:plain-text-body><![CDATA[ | [[SDN 2008 | AA. Bibliography#SDN 08]] | [Serialization FAQ | http://java.sun.com/javase/technologies/core/basic/serializationFAQ.jsp] | ]]></ac:plain-text-body></ac:structured-macro> |
...