...
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
OBJ11OBJ15-EX1: 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.
OBJ11OBJ15-EX2: System.gc()
may be invoked as a last resort in a catch
block that is attempting to recover from an OutOfMemoryError
.
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
OBJ11 OBJ15-J | low | likely | high | P3 | L3 |
Related Vulnerabilities
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="bca65c6b2f42b6cf-6cca897c-41384107-96bc9c6e-327d44e1f7518ca7160337a7"><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="b5cd0af795c05f2b-54ab3029-42db4334-80b996db-66092924d30171ad92c1a88c"><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="81ab2f106842e271-3e73442c-4add4394-b6c3b861-0e87991bc4d128fb3fba5b52"><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="065960b97a988149-5db08251-431744bb-aa7d8d3e-fa29f604f10b3133c7baeb31"><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="56afa1952e674932-1244adbb-4fbe4c70-bde4adbb-b93cbc67c0140493d12229aa"><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="909bc33ff99c9f1b-528d1795-4b884e0b-88b793bb-8f553127ccd7a91b02576f78"><ac:plain-text-body><![CDATA[ | [[Lo 2005 | AA. Bibliography#Lo 05]] | Security Issues in Garbage Collection | ]]></ac:plain-text-body></ac:structured-macro> |
...