发明名称 Methods and apparatus for dynamically preloading classes
摘要 A class preloading mechanism that dynamically preloads classes at runtime in a virtual machine (VM) environment. Data structures representing preloaded classes may be stored in a persistent module corresponding to a classloader. A persistent module can be directly mapped or copied into a memory region at runtime so that the classes may not have to be loaded from the class file container. The preloaded classes are not fully linked and resolved. When a classloader receives a class request, the classloader looks up the preloaded class in the memory region and completes linking and resolution of the class. Persistent modules may be pre-generated and, for example, installed with an application. Alternatively, a persistent module for a class file container may be generated at runtime by preloading classes from the class file container into a memory region and storing data structures representing the classes as a persistent module.
申请公布号 US9507613(B2) 申请公布日期 2016.11.29
申请号 US201213436476 申请日期 2012.03.30
申请人 Oracle International Corporation 发明人 Zhou Jiangli;Plummer Christopher Jordan;Long Dean Roy Ernest
分类号 G06F9/44;G06F9/455;G06F9/445 主分类号 G06F9/44
代理机构 Meyertons, Hood, Kivlin, Kowert & Goetzel, P.C. 代理人 Kowert Robert C.;Meyertons, Hood, Kivlin, Kowert & Goetzel, P.C.
主权项 1. A method, comprising: loading at least one class indicated by a classloader at runtime of a virtual machine (VM) environment on a device, wherein said loading comprises, for at least one class file container indicated by the classloader, prior to the classloader receiving requests for classes defined by the class file container: locating a persistent module external to the virtual machine environment and corresponding to the class file container, wherein the persistent module contains one or more data structures representing classes defined by one or more class files in the respective class file container, wherein the one or more data structures were previously saved to the persistent module based on a previous preloading, prior to said loading, of the classes represented by the one or more class files; and mapping or copying content of the persistent module to memory within the VM environment to preload the one or more classes from the persistent module into the VM environment without loading the one or more classes from respective class files in the class file container, wherein the one or more preloaded classes are not fully linked or resolved in the VM environment prior to the classloader receiving requests for the one or more classes, and wherein the one or more preloaded classes that are not fully linked or resolved are not made available in the VM environment for use by applications until after the classloader receives the requests for the one or more classes.
地址 Redwood City CA US