System and method for lazy loading of shared libraries
First Claim
1. A method for loading an executable program into memory from permanent storage, the method comprising the steps of:
- a) receiving a request for the executable program, wherein the executable program includes a main executable file and first level object libraries;
b) loading initial executable code of the main executable file into the memory;
c) fetching an executable header of the main executable file from the permanent storage, wherein the executable header includes identity of the first level object libraries;
d) obtaining a virtual memory entry for each object identified in the first level of object libraries;
e) loading an object identified in one of the first level object libraries when the object is referenced;
f) determining identity of the second level object library from the object;
g) determining when an object identified in the second level object library is needed for execution; and
h) when the object identified in the second level object library is needed, loading the object identified in the second level object library into the memory.
0 Assignments
0 Petitions
Accused Products
Abstract
Lazy loading of executable library objects reduces operating system overhead and memory commitment requirements by postponing object loading until object references are expected. Initial task loading allocates only the main executable and library objects referenced by that executable. Secondary referenced objects are not allocated. Object references cause page faults for allocated but not loaded pages. Page fault handling causes loading and fixup of executable objects. Page fault handling also determines the next level of object references and allocates memory for the next object level. Shared memory systems allow sharing of executable objects until explicitly referenced. Once referenced, memory fault causes copying and fixup to referencing task memory area.
-
Citations
7 Claims
-
1. A method for loading an executable program into memory from permanent storage, the method comprising the steps of:
-
a) receiving a request for the executable program, wherein the executable program includes a main executable file and first level object libraries; b) loading initial executable code of the main executable file into the memory; c) fetching an executable header of the main executable file from the permanent storage, wherein the executable header includes identity of the first level object libraries; d) obtaining a virtual memory entry for each object identified in the first level of object libraries; e) loading an object identified in one of the first level object libraries when the object is referenced; f) determining identity of the second level object library from the object; g) determining when an object identified in the second level object library is needed for execution; and h) when the object identified in the second level object library is needed, loading the object identified in the second level object library into the memory. - View Dependent Claims (2, 3, 4, 5)
-
-
6. An apparatus for loading an executable program into memory from permanent storage, the apparatus comprising:
-
tasking block; loading block; and virtual memory block; wherein, when a user space requests an executable program; the tasking block creates a task, registers the task with the virtual memory block, and causes the loader block to initiate memory loading of the executable program; the loader block accesses a main executable file and objects identified in first level object libraries based on a executable file header, loads initial executable code of the main executable file into user memory, and, for each object identified in one of the first level of libraries, provides a module table entry which is registered with the virtual memory block; the virtual memory block stores a virtual representation of the objects identified in the first level object libraries and a virtual representation of data of the main executable file; wherein, when the user space is executing the executable program; the tasking block detects when one of the objects identified in the first level object libraries is referenced by the initial executable code, generates a load command and determines a second level object library from the one of the objects identified in the first level object libraries; the virtual memory block, in response to the load command, determines whether the one of the objects identified in the first level object libraries is currently in the user memory, and when the one of the objects identified in the first level object libraries is not in the user memory, generates a page fault, and provides a virtual representation of objects identified in the second level object library; the loader block, in response to the page fault, accesses the one of the objects identified in the first level object libraries to load into the user memory. - View Dependent Claims (7)
-
Specification