...
In the Java Hotspot VM (default since JDK 1.2), System.gc()
forces an explicit garbage collection. Such calls can be buried deep within libraries, so they may be difficult to trace. To ignore the call in such cases, use the flag -XX:+DisableExplicitGC
. To avoid long pauses while performing a full GC, a less demanding concurrent cycle may be invoked by specifying the flag -XX:ExplicitGCInvokedConcurrent
.
Exceptions
OBJ15-EX1EX0: When an application goes through several phases such as an initialization and a ready phase, it could require heap compaction between phases. Given an uneventful period, System.gc()
may be invoked in such cases, provided that there is a suitable uneventful period between phases.
OBJ15-EX2EX1: System.gc()
may be invoked as a last resort in a catch
block that is attempting to recover from an OutOfMemoryError
.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6aa9568419111ee4-4f55014c-4a3e4940-8dbd9736-27efc3bbb50b23d9ee4bb176"><ac:plain-text-body><![CDATA[ | [[MITRE 2009 | AA. Bibliography#MITRE 09]] | [CWE-405 | http://cwe.mitre.org/data/definitions/405.html] "Asymmetric Resource Consumption (Amplification)" | ]]></ac:plain-text-body></ac:structured-macro> |
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="784b36cc32b56b87-3040c433-4d164dc2-b1b1ad65-768214a493acc4e18e323f29"><ac:plain-text-body><![CDATA[ | [[API 2006 | AA. Bibliography#API 06]] | Class | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ce971ae80a33971c-843e8b76-4bca429b-a356b832-f2e2044fd58b6bca9db0a339"><ac:plain-text-body><![CDATA[ | [[Bloch 2008 | AA. Bibliography#Bloch 08]] | Item 6: "Eliminate obsolete object references" | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f94dc233ea16cbdc-538c7020-428a4508-b0f092b4-10e9164dc99e1dbf1f7fe906"><ac:plain-text-body><![CDATA[ | [[Coomes 2007 | AA. Bibliography#Coomes 07]] | Garbage Collection Concepts and Programming Tips | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c97aabbe2089cfce-38f67207-45e545fb-be76b2f1-a2557010ed2f6c26af9cb8f8"><ac:plain-text-body><![CDATA[ | [[Goetz 2004 | AA. Bibliography#Goetz 04]] | Java theory and practice: Garbage collection and performance | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="dff59739335ac2e9-ecd03779-4ffc4188-923a9348-5b0da0b8ca9535255514a87b"><ac:plain-text-body><![CDATA[ | [[Lo 2005 | AA. Bibliography#Lo 05]] | Security Issues in Garbage Collection | ]]></ac:plain-text-body></ac:structured-macro> |
...