EP0943989A2

System and method for reducing the footprint of preloaded classes

Abstract

A method and system that reduces the ROM space allocated for internal data structures by a runtime engine (such as the Java virtual machine). The internal data structures store member information for preloaded classes used by applications executed by the runtime engine. The system determines the different types of internal data structures represented in the classes and identifies the possible values of each type's members. The system next determines the amount of space required to store the values for each type in a respective value table and the number of bits needed to index each entry of that table. The system determines based on the stored information whether occurrences of a member are optimally represented as a set of value table indices and a value table or, in the conventional manner, as a general variable that stores the member's value for each occurrence. This determination is based on the size of the general variable, the number of occurrences of the member, the memory needed for each index and the size of the value table.

EP0943989A2, drawing sheet 1
Sheet 1 of 14

Term

Term ended

Projected expiry passed 22 March 2019, 7.5 years ago.

  1. Priority
  2. Filed
  3. Published
  4. Projected expiry
  5. Today

11 claims: 8 independent, 3 dependent

  1. 1
    A method for reducing memory footprint of preloaded classes to be incorporated into a runtime environment, comprising the steps of:determining types of data structures represented in one or more class files used to define a plurality of preloaded classes, each of the data structure types including one or more members;determining distinct values that can be taken by each of the members;storing each of the values for at least a subset of the members selected to reduce the size of corresponding internal data structures composing the preloaded classes;generating a set of value indices for addressing stored values stored in the storing step;and generating accessor functions and member declarations that enable the runtime environment to use the selected members represented as the stored values and the set of value indices.
  2. 2
    A system for reducing the memory footprint of preloaded classes to be incorporated into a runtime environment, comprising:a set of class files;and a class preloader configured to generate from the class files a set of preloaded classes and a plurality of internal data structure declarations configured to minimize size of the preloaded classes when allocated in memory;the class preloader being configured to generate the internal data structure declarations so that each of a set of selected data structure members are represented as an index to a storage structure holding distinct values of the selected data structure member.
  3. 3
    A computer program product for use in a computer system for reducing the memory footprint of preloaded classes to be incorporated into a runtime environment executing on an execution engine, the computer program product including a computer readable storage medium and a computer program mechanism embedded therein, the computer program mechanism comprising:a class preloader configured to generate from a set of class files the preloaded classes and a plurality of internal data structure declarations configured to minimize size ofthe preloaded classes when allocated in memory of the execution engine;the class preloader being configured to generate the internal data structure declarations so that each of a set of selected data structure members are represented as an index to a storage structure holding distinct values of the selected data structure member.
  4. 4
    A runtime environment built from a collection of preloaded classes defined by one or more internal data structure types, each including one or more members, the runtime environment comprising:a storage structure holding distinct values that can be taken by at least a subset of the members;and an index to a storage structure entry holding the distinct value of a respective member of the subset of the members serving as each occurrence of the respective member with the distinct value;such that the runtime environment determines when necessary the distinct value of the respective member by retrieving contents of the storage structure at a location defined by the index.
  5. 6
    A method for loading an execution engine with preloaded classes to be incorporated into a runtime environment to be executed on the execution engine, comprising:downloading into the execution engine the preloaded classes, including a plurality of internal data structure declarations composing the preloaded classes configured so that each of a set of selected data structure members is represented as an index to a stored distinct value of the selected data structure member, the set being selected to minimize size of the preloaded classes when allocated in memory of the execution engine.
  6. 9
    A method for generating and loading into a client preloaded classes to be incorporated into a runtime environment to be executed on the client, comprising:generating in a server the preloaded classes, including a plurality of internal data structure declarations composing the preloaded classes configured so that each of a set of selected data structure members is represented as an index to a storage structure holding distinct values of the selected data structure member, the set being selected to minimize size of the preloaded classes when allocated in memory of the client;and downloading into the client the preloaded classes.
  7. 10
    A method for reducing memory footprint of preloaded classes to be incorporated into a runtime environment, comprising the steps of:determining distinct values that can be taken by members of internal data structures composing the preloaded classes;storing each of the values for at least a subset of the members selected to reduce the size of the internal data structures;and replacing each occurrence of a subset member with an index to the value of that occurrence, enabling the value of that occurrence to be retrieved via the index.
  8. 11
    A system for reducing the memory footprint of preloaded classes to be incorporated into a runtime environment, comprising:a class preloader configured to generate a set of internal data structure declarations configured to minimize size of the preloaded classes when allocated in memory, the internal data structure declarations declaring internal data structures composing the preloaded classes;the class preloader being configured to generate the internal data structure declarations so that each of a set of selected data structure members is represented as an index to a storage structure holding distinct values of the selected data structure member.