Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6200079
Votes 0
Synopsis Apply -XX:+DisableExplicitGC to new JVM versions by default
Category hotspot:garbage_collector
Reported Against 5.0
Release Fixed
State 11-Closed, Not a Defect, request for enhancement
Priority: 3-Medium
Related Bugs
Submit Date 24-NOV-2004
Description
It is legal Java practice to initiate a Full GC by calling System.gc(). In old days when memory was limited and heap sizes of Java apps were rather small this was common practice which did not cause harm because full GC runs only took a short time to execute.
With ever larger Java server applications with many threads and heap sizes in the GB range such calls can easily bring a JVM to a virtual halt. Frequently System.gc() calls are introduced by third party libraries or products and the application developers are not aware of them. In these cases, the problem can cause serious performance degradation and project desperation.
The problem can be easily fixed by the -XX:+DisableExplicitGC JVM switch. As most developers don't know this, it would be very useful to apply this switch by default. On the other hand, this should cause no problems to applications which have been making use of System.gc() calls so far. Strictly speaking these calls serve no obvious purpose.
Work Around
Apply the switch -XX:+DisableExplicitGC to the JVM (most customers ignore the problem and the solution, however)
  xxxxx@xxxxx   2004-11-24 18:14:55 GMT
Evaluation
Many problems for Java software projects would never appear. The platform would be more robust.
  xxxxx@xxxxx   2004-11-24 18:14:55 GMT

This seems like a really bad idea.  We should educate people not to call System.gc(), not break any programs that are currently using it in the few situations where it is necessary.  E.g., src/share/classes/java/nio/Bits.java.  People who have third-party libraries that call System.gc() too much should lean on their vendors to fix their libraries.

This would also break a large amount of our test code, which seems to call System.gc() for its own reasons.
  xxxxx@xxxxx   2004-11-24 19:40:38 GMT
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang