United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6867645 java -Xshare:dump failed - read only space too small
6867645 : java -Xshare:dump failed - read only space too small

Details
Type:
Bug
Submit Date:
2009-08-01
Status:
Closed
Updated Date:
2010-12-03
Project Name:
JDK
Resolved Date:
2010-01-13
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs16

Related Reports
Backport:
Backport:

Sub Tasks

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
                                     
2009-08-13
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 ] ###@###.###
                                     
2009-08-12
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,                                \
                                     
2009-08-12
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.
                                     
2009-08-05
WORK AROUND

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



Hardware and Software, Engineered to Work Together