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: 6186200
Votes 0
Synopsis RFE: Stall allocation requests while heap is full and GC locker is held
Category hotspot:garbage_collector
Reported Against beta
Release Fixed mustang(b37), 1.3.1_17(b01) (Bug ID:2128168) , 1.4.2_11(b01) (Bug ID:2128915) , 5.0u7(b01) (Bug ID:2128916)
State 10-Fix Delivered, request for enhancement
Priority: 2-High
Related Bugs 6266681 , 6280181 , 6356960 , 6450320 , 6507548 , 6539517 , 6700062 , 6736295 , 6782457 , 6789220 , 6190855 , 5101236
Submit Date 28-OCT-2004
Description
As implicit in the synopsis above, suppose the heap is getting
nearly full and a GC will shortly be needed to satisfy any new
requests. Suppose that, at this juncture, one thread T1 in a multi-threaded
application acquires the gc locker in order to do a pretty short duration
operation. At this point, let us say T1 gets descheduled and
another thread T2 makes a java heap allocation request that cannot
be satisfied without a GC.

As currently implemented, we may bring the world to a safepoint,
and attempt a GC, realize that gc locker has locked out GC and
return NULL, signifying our failure to allocate the requested
storage. T2 will get an OOM which it can decide to catch and
deal with as appropriate, or it might not catch it and get
terminated.

A different implementation possibility is to hold the request of
thread T2 in abeyance (not returning the NULL) until such time
as we are able to do a garbage collection (i.e. when the gc locker
is vacated). Would that be a more friendly or useful behaviour
for applications?

Of course, in such a design we would need to consider the possibility
that a thread that holds the gc locker is itself making the allocation
request. That should be easy to track with just a little state
(i think already present) in the thread and in such cases we can and
would return a NULL because we would otherwise risk deadlock.

However, there might be more subtle deadlocks possible if T1's
operation has a circular dependency on T2's allocation via
a dependency chain not directly visible to the JVM. Clearly,
that would be a violation of the JNI spec by the programmer,
as to the restrictions on using critical lockers, and the
JVM could just shrug off responsibility for such user violations.
  xxxxx@xxxxx   10/28/04 19:13 GMT
Work Around
N/A
Evaluation
Bug has been fixed, and tested successfully with big apps and using
targeted regression tests. The fix will be putback to
Mustang upon CCC approval; see http://ccc.sfbay/6186200.


  xxxxx@xxxxx   2005-04-18 21:06:41 GMT
To the SDN user who asked which versions this is fixed in:
----------------------------------------------------------

This is a bug in at least each of the 1.3.1, 1.4.2, 5.0 trains,
and is fixed in 1.3.1_17, 1.4.2_11 and 5.0u7 releases of those
trains. It's also fixed in Mustang (6.0) beta b37. This information
is also visible in the "Fixed in" field of the bug report.
Posted Date : 2006-04-25 22:13:25.0
Comments
  
  Include a link with my name & email   

Submitted On 24-APR-2006
Is there this bug  in  which versions of JDK ?  Is there the bug  in jdk 1.4.2_6?


Submitted On 02-MAY-2006
gojomo
Does '5.0u7' mean the as-yet-unreleased 1.5.0_7?



PLEASE NOTE: JDK6 is formerly known as Project Mustang