JDK-6287811 : ergonomics OutOfMemoryError should not report as 'java heap space'
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 5.0,6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,linux
  • CPU: generic,itanium
  • Submitted: 2005-06-20
  • Updated: 2017-05-16
  • Resolved: 2006-02-15
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 Availabitlity Release.

To download the current JDK release, click here.
JDK 6
6 b72Fixed
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_03-b07, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux crawling015.archive.org 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:16:33 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
Any GC system with 'ergonomics' (ParallelGC, and apparently CMS in 1.6) can throw OutOfMemoryError even when there's plenty of heap space left, but GC has been taking 'too much' time. These errors, however, include the misleading explanation string "java heap space". They should instead say something like 'ergonomics GC time limits exceeded' instead, so that people receiving the error know what's really happened.

The OOM errors in all of these bugs appear due to ergonomics, remediable via the undocumented -XX:-UseGCTimeLimit JVM flag, but may have confused those experiencing the problem because they report as "java.lang.OutOfMemoryError: Java heap space".

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run one of the memory-exhaustion-type tests in the above-referenced bugs.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
OutOfMemoryError that is thrown mentions true cause, ergonomics timeout, rather than "Java heap space"
ACTUAL -
java.lang.OutOfMemoryError: Java heap space

ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.OutOfMemoryError: Java heap space

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Read lots of bugs to understand the real reason for the OOMs. Use the secret -XX:-UseGCTimeLimit JVM flag.
###@###.### 2005-06-20 06:49:38 GMT

Comments
SUGGESTED FIX Event: putback-to Parent workspace: /net/jano.sfbay/export/disk05/hotspot/ws/main/gc_baseline (jano.sfbay:/export/disk05/hotspot/ws/main/gc_baseline) Child workspace: /net/prt-web.sfbay/prt-workspaces/20060111122704.jmasa.gc_baseline_detail/workspace (prt-web:/net/prt-web.sfbay/prt-workspaces/20060111122704.jmasa.gc_baseline_detail/workspace) User: jmasa Comment: --------------------------------------------------------- Job ID: 20060111122704.jmasa.gc_baseline_detail Original workspace: arches:/net/spot/archive02/jmasa/workspaces/gc_baseline_detail Submitter: jmasa Archived data: /net/prt-archiver.sfbay/data/archived_workspaces/main/gc_baseline/2006/20060111122704.jmasa.gc_baseline_detail/ Webrev: http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/gc_baseline/2006/20060111122704.jmasa.gc_baseline_detail/workspace/webrevs/webrev-2006.01.11/index.html http://analemma.sfbay.sun.com/net/spot/archive02/jmasa/workspaces/gc_baseline_detail/webrev/ Partial 6287811: ergonomics OutOfMemoryError should not report as 'java heap space' When an out of memory is thrown because of the gc time limit, the detail string reads java.lang.OutOfMemoryError: GC overhead cost Reviewed by: Ramki, John, and Peter Approved for b68. Fix verified (y/n): y Verification testing: Ran GCOldOOM with the command line -Xmx48m -Xms48m -XX:GCTimeLimit=0 -XX:GCHeapFreeLimit=100 -XX:+UseParallelGC GCOldOOM 24 1 20 10 2000 and observed the output java.lang.OutOfMemoryError: GC overhead limit exceeded at GCOldOOM.doYoungGenAlloc(GCOldOOM.java:301) at GCOldOOM.doStep(GCOldOOM.java:318) at GCOldOOM.main(GCOldOOM.java:359) Other testing: runThese -quick -testbase_vm -testbase_gc with product build and cms (sparc) and PS (linux i586) with ergonomics on runThese -quick -testbase_vm -testbase_gc with product build and cms (sparc) with ergonomics off runThese -quick -testbase_vm -testbase_gc with fastdebug build and PS (linux i586) with ergonomics on Files: update: src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp update: src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp update: src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp update: src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp update: src/share/vm/gc_interface/collectedHeap.hpp update: src/share/vm/gc_interface/collectedHeap.inline.hpp update: src/share/vm/memory/collectorPolicy.cpp update: src/share/vm/memory/collectorPolicy.hpp update: src/share/vm/memory/concurrentMarkSweepGeneration.cpp update: src/share/vm/memory/genCollectedHeap.cpp update: src/share/vm/memory/genCollectedHeap.hpp update: src/share/vm/memory/universe.cpp update: src/share/vm/memory/universe.hpp update: src/share/vm/runtime/vmStructs.cpp Examined files: 3765 Contents Summary: 14 update 3751 no action (unchanged)
2006-01-18

EVALUATION See suggested fix section.
2006-01-18