question 4

Posted Thursday, September 03, 2009 by SacrosanctBlood in

What is Class data sharing?



1 comment(s) to... “question 4”

1 comments:

SacrosanctBlood said...

The Class data sharing concept provides that JRE does all of the basic
classloading and parsing just once, and stores the resulting memory
structures in a file (classes.jsa, with jsa standing for Java Shared
Archive). The next time the JRE boots, it simply maps this file into
memory, and can skip all of the messy classloading. In addition to
performance, another benefit is the fact that a big chunk of the mapped
bytes can be shared by all running JREs, so they do not each need an
independent copy of all of the code.

If you use diff or a similar tool to compare JRE directories from
various machines running the same JRE version, you'll most likely find
that the classes.jsa files, and only those files, are different. That's
because classes.jsa is actually generated on your machine, instead of
packaged with the installer. One of the last things the JRE installer
does is run the magic incantation java -Xshare:dump, which causes the
shared archive to be generated. Some aspects of the file may be
machine-dependent.



Post a Comment