A Java OutofMemoryError
occurs if the program attempts to use more heap space than is available. Among other causes, this error may result from
- a memory leak (see MSC05 MSC04-J. Do not leak memory)
- 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
(see SER10-J. Avoid memory and resource leaks during serialization) - creating a large number of threads
- uncompressing a file (see IDS04-J. Limit the size of files passed to ZipInputStream)
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b0bc2a6aab890930-6b809a6b-47b64dca-92ffae3d-165727bc6d69a3327536849d"><ac:plain-text-body><![CDATA[ | [ISO/IEC TR 24772:2010 | http://www.aitcnet.org/isai/] | "Resource Exhaustion [XZP]" | ]]></ac:plain-text-body></ac:structured-macro> |
CWE-400, "Uncontrolled Resource Consumption ('Resource Exhaustion')" | ||||
| CWE-770, "Allocation of Resources Without Limits or Throttling" |
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e15f1ed15f322185-212e6c88-4a1248d6-8d1e85c6-29f37172206d48f3bc02b861"><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="22018102c66b357f-ab303b85-4a434836-a8649d61-d724ad42c8eed9c9238b9ef8"><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="ba9034fb9a213356-0f54ac24-4d73409e-90049669-b76f14d7088d229ff9431662"><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="8570c36e24362782-061e7477-44054969-8878bcc9-945e4f9b549d86244e9eced4"><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="d59adc7120901b6a-d8c174d5-4a0a4cd1-baee8408-61272fd477a8ad66f4f988b7"><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> |
...
MSC05-J. Do not leak memory 49. Miscellaneous (MSC) MSC08-J. Do not modify the underlying collection when an iteration is in progress