This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Difference between revisions of "Code Correctness: Call to System.gc()"

From OWASP
Jump to: navigation, search
Line 18: Line 18:
  
 
==Related Attacks==
 
==Related Attacks==
 +
 +
[[:Category:API Abuse Attack]]
  
 
==Related Vulnerabilities==
 
==Related Vulnerabilities==
Line 25: Line 27:
 
==Categories==
 
==Categories==
  
[[Category:API Abuse Attack]]
+
[[Category: Use of Dangerous API]]
  
 
[[Category:Java]]
 
[[Category:Java]]
  
 
[[Category:Implementation]]
 
[[Category:Implementation]]

Revision as of 17:38, 18 July 2006

This article includes content generously donated to OWASP by MicroFocus Logo.png

This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.


Abstract

Explicit requests for garbage collection are a bellwether indicating likely performance problems.

Description

At some point in every Java developer's career, a problem surfaces that appears to be so mysterious, impenetrable, and impervious to debugging that there seems to be no alternative but to blame the garbage collector. Especially when the bug is related to time and state, there may be a hint of empirical evidence to support this theory: inserting a call to System.gc() sometimes seems to make the problem go away.

In almost every case we have seen, calling System.gc() is the wrong thing to do. In fact, calling System.gc() can cause performance problems if it is invoked too often.

Examples

Related Threats

Related Attacks

Category:API Abuse Attack

Related Vulnerabilities

Related Countermeasures

Categories