JDK-4928472 : Should not call GC when AWT encounters an out of memory error
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2_17,6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows,windows_xp
  • CPU: x86
  • Submitted: 2003-09-25
  • Updated: 2010-02-01
  • Resolved: 2005-08-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other Other Other Other JDK 6
1.4.2_25-revFixed 1.4.2_26-revFixed 1.4.2_27Fixed 5.0u24-revFixed 5.0u25Fixed 6 b49Fixed
Related Reports
Relates :  
Description
In awt_new.cpp, AWT has a handler for memory allocation.  When an allocation 
fails (either malloc or new), this handler is invoked.  It tries to compact 
the heap by invoking the garbage collector, and if successful, tries the 
memory allocation again.  This may have made sense in the days when we were 
using the Symantec JIT, but it doesn't anymore.  In fact, it has caused 
problems for the VM team.  They have asked that the handler be removed.  

Throwing an OutOfMemory Exception is fine, but invoking the garbage collector 
is not.  

The handler function is: 

// Called when malloc or operator new runs out of memory. We try to
// compact the heap by initiating a Java GC. If the amount of free
// memory available after this operation increases, then we return
// (1) to indicate that malloc or operator new should retry the
// allocation. Returning (0) indicates that the allocation should fail.
int
NewHandler::handler(size_t) {

Comments
EVALUATION See description.
29-07-2005

SUGGESTED FIX Remove the context of NewHandler::handler almost completely, leave only error message
29-07-2005

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
08-09-2004

EVALUATION Should try to fix for 1.5.1. ###@###.### 2003-09-25
25-09-2003