Boot module analyzer

Mandy Chung Mandy.Chung at Sun.COM
Tue Nov 24 12:26:18 PST 2009


I have been looking into defining a minimal boot module.   I started 
with analyzing the dependencies from the list of classes preloaded by 
the VM during boot time.   With the ~56 VM preloaded classes as roots, 
transitive closure of their dependencies ends up pulling in ~2000 
classes (with the same exclude rules as the base module).    To define a 
minimal boot module, the module definition would require listing 
individual classes and many filters to exclude classes that are not 
needed during boot time.   Such module definition file would be hard to 
maintain and very fragile as there is no simple pattern to define the 
boot module.   Manual creation of the boot module definition is error-prone.

I created a new tool, boot module analyzer, to generate the module 
definition for the boot module ("boot.config") by doing the method-level 
dependency analysis.  Similar to the class analyzer, it reads a given 
configuration file that lists the methods as roots and follows the 
dependencies from the methods that are referenced.   The output 
boot.config can be used as the input to the class analyzer to generate 
the class list, summary, and dependencies for the boot module.

http://cr.openjdk.java.net/~mchung/jigsaw/tools/webrev.bootmodule/

The boot analyzer finds dependencies by analyzing the code attribute of 
the methods and see the BootAnalyzer class description for details about 
the implementation and its limitation.   See 
make/config/bootmodule.roots for the configuration and unsupported features.

To generate the boot.config, run:
   make/bootanalyzer.sh -jdkhome <jdkhome> -output <dir> [-classlist]

The -classlist option is added mainly for convenience way for sanity 
check.    Class analyzer should be used to generate the class list for 
the boot module as well as other modules.

The boot module for jdk7 b76 currently defined contains:
   Total: 2307814 bytes (uncompressed) 934 classes

Some inner classes are not needed during boot.   They can be refactored 
as a package-private class so that they will not be included in the boot 
module.   I'll also be looking into any dependency that can be 
eliminated and the classes needed to support the missing features.

Mandy





More information about the jigsaw-dev mailing list