Real-Time Class Package to Archive Mapping Index
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In object-oriented programming environments, the performance is hindered by the need for extensive searches of class archive files, particularly in large applications, due to the lack of a mechanism for creating a Java package to JAR mapping index in real-time, leading to resource-intensive class path searches.
Innovation Solution
A class loader with a mapping mechanism that creates and updates a real-time class package to file archive mapping index, optimizing access by searching the class path starting from the last listed archive when a class is not found, and utilizing a large package list to balance index entries and reduce resource usage.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If a mapping index is created to reduce class path search time, then class loading performance is improved, but the system requires pre-processing which is not practical in complex and changing environments
Solution Approach 1:
The patent implements a dynamic mapping index that is built and updated in real-time as classes are loaded, rather than requiring pre-processing. The class loader dynamically constructs the mapping index by recording class package to JAR mappings during normal operation, allowing the system to adapt to changing class paths without prior preparation or manual configuration.
Solution Approach 2:
The class loading system performs self-configuration by automatically building its own mapping index during operation. The class loader records mappings between class packages and JAR files as it loads classes, eliminating the need for external pre-processing tools or manual index creation. This self-service approach allows the system to optimize itself without external intervention.
2Length of moving object
If all JARs are combined into one or a few large JARs to decrease the search path, then search path length is reduced, but code reuse capability is compromised and class path search order cannot be maintained
Solution Approach 1:
The patent maintains the segmentation of JAR files into multiple separate archive files, preserving the ability to load classes from different JARs independently. This allows the system to maintain code reuse capabilities and respect class path search order while using a mapping index to optimize the search process without physically combining JARs.
Solution Approach 2:
The mapping index acts as an intermediary data structure that mediates between the class path search requirements and the JAR file storage structure. It provides fast lookup information about which JARs contain which classes without changing the physical arrangement of JAR files, allowing the system to maintain both search optimization and JAR separation.
3Speed
If a comprehensive mapping index is built for all classes, then class loading speed is improved, but memory resources are consumed and the index becomes complex to maintain in changing environments
Solution Approach 1:
The patent implements a partial mapping index that records only the necessary mappings between class packages and JAR files for classes that are actually loaded. Rather than building a comprehensive index of all possible classes, the system maintains an index entries only for classes that have been or will be loaded, reducing memory consumption while still providing fast lookup for active classes.
Solution Approach 2:
The mapping index is dynamically updated by adding entries when classes are loaded and removing or updating entries when classes are unloaded or no longer needed. The system discards obsolete mapping information and recovers memory by not maintaining entries for classes that are no longer part of the active class path, keeping the index size proportional to current needs.
Data Source
AI summary
According to the preferred embodiments, an apparatus and method is described for creating a real-time class package to class archive file mapping index that improves the performance of a class loader to load needed classes in an object oriented programming environment. In preferred embodiments, the class loader includes a mapping mechanism that creates and maintains a real-time class package to file archive mapping index. In preferred embodiments, the mapping mechanism optimizes access to the file archive mapping index. In a preferred embodiment, when the mapping mechanism finds a entry in the file archive mapping index for the package, but the class is not found, the class is searched in the class path beginning from the last file archive listed in the index to optimize the search. In other embodiments, the class loader includes a large package list that is used to further optimize access to the archive index.


