JDK-6226790 : UseParNewGC causes OutOfMemoryError
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_7
  • CPU: sparc
  • Submitted: 2005-02-08
  • Updated: 2010-04-03
  • Resolved: 2005-02-09
Related Reports
Duplicate :  
Relates :  
Description
Bug Description: $cat  sb.java

import java.util.Vector;

public class sb extends Thread {
  public static void main(String[] strings) {
    for (int i = 0; i < 20; i++) {
      sb var_sb = new sb();
      var_sb.start();
    }
  }

  public void run() {
    doit();
  }

  void doit() {
    for (int i = 0; i < 100000000; i++)
      dosb();
  }

  void dosb() {
    Vector vector = getFilledVector();
    StringBuffer stringbuffer = new StringBuffer();
    for (int i = 0; i < 200000; i++)
      stringbuffer.append(".");
    try {
      Thread.sleep(100);
    } catch (InterruptedException interruptedexception) { }
  }

  Vector getFilledVector() {
    Vector vector = new Vector();
    for (int i = 0; i < 200; i++)
      vector.add(Integer.toString(i));
    return vector;
  }
}

$>uname -a
SunOS hppdl694 5.8 Generic_108528-14 sun4u sparc SUNW,Ultra-4
$>java -server -XX:+UseParNewGC sb

Exception java.lang.OutOfMemoryError: requested 589832 bytes for promotion. Out of swap space?

Description :-

ParNewGC will abort if it fails in promotion.  It should recover
from the situation and perform Full GC as ParallelGC does.

Still fails with Mustang

###@###.### 2005-2-08 19:12:28 GMT

Comments
EVALUATION Duplicate of 6206427. In which release does customer want fix? ###@###.### 2005-2-09 17:28:00 GMT Also duplicate of 6206166 which perhaps more precisely describes the problem that the customer is hitting. ###@###.### 2005-03-10 15:09:26 GMT
09-02-2005

WORK AROUND Use ParallelGC ###@###.### 2005-2-08 19:12:28 GMT Explictly use -XX:+HandlePromotionFailure with +UseParNewGC. +HandlePromotionFailure is available in 1.5.0 and beyond. This will become the default with 1.6.0; see 6206427. ###@###.### 2005-2-09 17:28:00 GMT
08-02-2005