JDK-6867645 : java -Xshare:dump failed - read only space too small
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-08-01
  • Updated: 2010-12-03
  • Resolved: 2010-01-13
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.
JDK 6 JDK 7 Other
6u18Fixed 7Fixed hs16Fixed
Description
Hi-

Several of my JDK7 JPRT build/test jobs failed recently with:

> > Failure reason:  Target solaris_i586-fastdebug-c1-jvm98 FAILED. The
> >   preparation of the built bits failed.  Post install step failed:
> >   rv=2,stdout="Loading classes to share ... done. 
> > Rewriting and unlinking classes ... done. 
> > Calculating hash values for String objects .. done. 
> > Calculating fingerprints ... done. 
> > Removing unshareable information ... done. 
> > Moving pre-ordered read-only objects to shared space at 0xd8000000 ... done. 
> > Moving read-only objects to shared space at 0xd85eb338 ... done. 
> > Moving common symbols to shared space at 0xd85ed2e8 ... done. 
> > Moving remaining symbols to shared space at 0xd86c2728 ... done. 
> > Moving string char arrays to shared space at 0xd86c38d8 ... done. 
> > Moving additional symbols to shared space at 0xd8782d08 ... Java HotSpot(TM)
> >   Client VM warning: 
> > The permanent generation read only space is not large enough to 
> > preload requested classes.  Use -XX:SharedReadOnlySize= to increase 
> > the initial size of the read only space.
> > 
> > ",stderr="" Target solaris_i586-fastdebug-c2-jvm98 FAILED. The preparation of
> >   the built bits failed.  Post install step failed: rv=2,stdout="Loading
> >   classes to share ... done. 
> > Rewriting and unlinking classes ... done. 
> > Calculating hash values for String objects .. done. 
> > Calculating fingerprints ... done. 
> > Removing unshareable information ... done. 
> > Moving pre-ordered read-only objects to shared space at 0xd8000000 ... done. 
> > Moving read-only objects to shared space at 0xd85eb338 ... done. 
> > Moving common symbols to shared space at 0xd85ed2e8 ... done. 
> > Moving remaining symbols to shared space at 0xd86c2728 ... done. 
> > Moving string char arrays to shared space at 0xd86c38d8 ... done. 
> > Moving additional symbols to shared space at 0xd8782d08 ... Java HotSpot(TM)
> >   Client VM warning: 
> > The permanent generation read only space is not large enough to 
> > preload requested classes.  Use -XX:SharedReadOnlySize= to increase 
> > the initial size of the read only space.
> > 
> > ",stderr="" Target solaris_x64-fastdebug-c2-jvm98 FAILED. The preparation of
> >   the built bits failed.  Post install step failed: rv=2,stdout="Loading
> >   classes to share ... done. 
> > Rewriting and unlinking classes ... done. 
> > Calculating hash values for String objects .. done. 
> > Calculating fingerprints ... done. 
> > Removing unshareable information ... done. 
> > Moving pre-ordered read-only objects to shared space at 0xd8000000 ... done. 
> > Moving read-only objects to shared space at 0xd85eb338 ... done. 
> > Moving common symbols to shared space at 0xd85ed2e8 ... done. 
> > Moving remaining symbols to shared space at 0xd86c2728 ... done. 
> > Moving string char arrays to shared space at 0xd86c38d8 ... done. 
> > Moving additional symbols to shared space at 0xd8782d08 ... Java HotSpot(TM)
> >   Client VM warning: 
> > The permanent generation read only space is not large enough to 
> > preload requested classes.  Use -XX:SharedReadOnlySize= to increase 
> > the initial size of the read only space.
> > 
> > ",stderr=""

It appears the fastdebug build has grown enough to blow through some
preallocated size.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/10d8c0d0d60e
13-08-2009

SUGGESTED FIX diff -r b32a809aab08 -r 10d8c0d0d60e src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Tue Aug 11 23:24:41 2009 -0700 +++ b/src/share/vm/runtime/globals.hpp Wed Aug 12 14:27:54 2009 -0700 @@ -3287,7 +3287,7 @@ product(uintx, SharedReadWriteSize, 12*M, \ "Size of read-write space in permanent generation (in bytes)") \ \ - product(uintx, SharedReadOnlySize, 8*M, \ + product(uintx, SharedReadOnlySize, 10*M, \ "Size of read-only space in permanent generation (in bytes)") \ \ product(uintx, SharedMiscDataSize, 4*M, \
12-08-2009

EVALUATION Only occurs with fastdebug builds of the JDK, which use more space in the shared archive: over 1M more for "pre-ordered read-only objects" plus fairly small additional amounts for other components. This affects both product and fastdebug JVMs. Will increase the default SharedReadOnlySize from 8M to 10M in globals.hpp. *** (#1 of 1): [ UNSAVED ] ###@###.###
12-08-2009

WORK AROUND The fastdebug build is very close to the perm gen limit. This fails when using the latest nightly build on solaris-x86: /opt/java/jdk1.7.0-b68-2009-08-04/fastdebug/bin/java -XX:SharedReadOnlySize=8100K -Xshare:dump This works: % /opt/java/jdk1.7.0-b68-2009-08-04/fastdebug/bin/java -XX:SharedReadOnlySize=8193K -Xshare:dump VM option 'SharedReadOnlySize=8193K' Loading classes to share ... done. Rewriting and unlinking classes ... done. Calculating hash values for String objects .. done. Calculating fingerprints ... done. Removing unshareable information ... done. Moving pre-ordered read-only objects to shared space at 0xd6400000 ... done. Moving read-only objects to shared space at 0xd69eb338 ... done. Moving common symbols to shared space at 0xd69ed2e8 ... done. Moving remaining symbols to shared space at 0xd6ac2728 ... done. Moving string char arrays to shared space at 0xd6ac38d8 ... done. Moving additional symbols to shared space at 0xd6b82c68 ... done. Read-only space ends at 0xd6c5f6c8, 8779464 bytes. Moving pre-ordered read-write objects to shared space at 0xd6e00000 ... done. Moving read-write objects to shared space at 0xd750cd80 ... done. Moving String objects to shared space at 0xd754a668 ... done. Read-write space ends at 0xd7596d78, 7957880 bytes. Updating references to shared objects ... done.
05-08-2009

WORK AROUND jprt rerun -c "..." -excludetests '.*fastdebug-.*-jvm98.*' ... <JPRT-ID>
01-08-2009