Adaptive class loading
AssigneeInternational Business Machines Corporation
InventorsBrian Keith Martin, Daniel John Moravec, Thomas Edward Musta, Eric Jon Van Norman
Life of this patent
Estimating the term…
Abstract
A method, apparatus, system, and signal-bearing medium that, in an embodiment, determine the classes that are needed during a first invocation of an application and preload those classes during a subsequent invocation of the application. In various embodiments, the classes may be preloaded if they are within a specified package, if they were needed greater than a threshold number of times, if the class path did not change between the first invocation and the subsequent invocation, or if the jar files the contain the classes are in a class path. In this way, an embodiment of the invention may increase the performance of class preloading.
Claims8
A method comprising:
- interpreting a plurality of statements during a first invocation of an application;
- determining a first plurality of classes that are requested to be loaded by the plurality of statements during the first invocation of the application and that meet a filter criteria specified by the user, wherein the filter criteria specifies a second plurality of classes that are to be included in the first plurality of classes, and wherein the filter criteria specifies a third plurality of classes that are to be excluded from the first plurality of classes;
- determining a plurality of jar files that contain the first plurality of classes during the first invocation of the application;
- counting a plurality of a number of references to the first plurality of respective classes by the plurality of statements during the first invocation of the application;
- deciding whether the plurality of jar files are in a class path during the first invocation of the application;
- determining whether each of the plurality of the number of the references to the first plurality of respective classes by the plurality of statements during the first invocation of the application is greater than a threshold;
- determining whether the class path has changed between the first invocation and a subsequent invocation of the application;
- and
- preloading the plurality of classes during the subsequent invocation of the application if the plurality of jar files were in the class path during the first invocation of the application, each of the plurality of the number of the references to the first plurality of respective classes by the plurality of statements during the first invocation of the application is greater than the threshold, and the class path has not changed between the first invocation and the subsequent invocation of the application.
A method for configuring a computer, comprising:
- configuring the computer to interpret a plurality of statements during a first invocation of an application;
- configuring the computer to determine a first plurality of classes that are requested to be loaded by the plurality of statements during the first invocation of the application and that meet a filter criteria specified by the user, wherein the filter criteria specifies a second plurality of classes that are to be included in the first plurality of classes, and wherein the filter criteria specifies a third plurality of classes that are to be excluded from the first plurality of classes;
- configuring the computer to determine a plurality of jar files that contain the first plurality of classes during the first invocation of the application;
- configuring the computer to count a plurality of a number of references to the first plurality of respective classes by the plurality of statements during the first invocation of the application;
- configuring the computer to decide whether the plurality of jar files are in a class path during the first invocation of the application;
- configuring the computer to determine whether each of the plurality of the number of the references to the first plurality of respective classes by the plurality of statements during the first invocation of the application is greater than a threshold;
- configuring the computer to determine whether the class path has changed between the first invocation and a subsequent invocation of the application;
- and
- configuring the computer to preload the plurality of classes during the subsequent invocation of the application if the plurality of jar files were in the class path during the first invocation of the application, each of the plurality of the number of the references to the first plurality of respective classes by the plurality of statements during the first invocation of the application is greater than the threshold, and the class path has not changed between the first invocation and the subsequent invocation of the application.
Dependencies are inferred from the claim text.