Bug 878181

Summary: OpenJDK 1.7 does not create classes.jsa after installation
Product: [Fedora] Fedora Reporter: Lukas Zapletal <lzap>
Component: java-1.7.0-openjdkAssignee: Deepak Bhole <dbhole>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ahughes, dbhole, jerboaa, jvanek, omajid
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-19 20:47:15 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Lukas Zapletal 2012-11-19 14:55:33 EST
IBM contributed -Xshare option to Java (and OpenJDK as well):

$ java -X 2>&1 | grep share
    -Xshare:off       do not attempt to use shared class data
    -Xshare:auto      use shared class data if possible (default)
    -Xshare:on        require using shared class data, otherwise fail.

More about this: http://www.ibm.com/developerworks/library/j-sharedclasses/?ca=dgr-jw22ClassShareJRE&S_Tact=105AGX59&S_cmp=GRsitejw22

The option can be used to share classes and improve loading times, which can be dramatic. For Windows, classes cache is generated by default. In Fedora, the cache is not created.

I recommend to run the following command in the post installation section of the RPM package:

java -Xshare:dump

It creates about 25 MB file /usr/lib/jvm/java-1.7.0-openjdk-

Using -Xshare user can take advantage of faster loading, it can be measure even on the hello world application (much more on big applications like Eclipse):

[lzap@lzapx Download]$ time java -Xshare:on -cp . HelloWorldApp
Hello World!

real	0m0.051s
user	0m0.038s
sys	0m0.012s

[lzap@lzapx Download]$ time java -Xshare:off -cp . HelloWorldApp
Hello World!

real	0m0.076s
user	0m0.061s
sys	0m0.012s

By default it should use the class cache if it is found, but this is not working (is this a bug?):

[lzap@lzapx Download]$ time java -cp . HelloWorldApp
Hello World!

real	0m0.072s
user	0m0.054s
sys	0m0.017s

Tested with F16 and F17, selecting rawhide as I expect this is not implemented.
Comment 1 Andrew John Hughes 2012-11-19 20:47:15 EST

*** This bug has been marked as a duplicate of bug 513605 ***