Dynamic Class Unloading via Reference Mapping Table
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing electronic device systems occupy excessive memory space due to preloading all classes, even if not all are frequently used, as classes are not dynamically unloaded during the application's operation process.
Innovation Solution
A class unloading method that generates a reference mapping table to track reference and dependency relationships between classes, allowing for dynamic unloading based on preset conditions such as priority thresholds, thereby releasing memory space.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If all classes are preloaded into memory in a global loading manner, then memory space is saved by allowing all processes to share the same class, but a great amount of memory space is occupied by classes that are not frequently used
Solution Approach 1:
The patent implements dynamic class loading and unloading mechanisms. Classes are loaded into memory only when needed based on application requirements, and unloaded when not in use. This dynamic approach allows the system to adapt memory usage to actual needs, resolving the contradiction between maintaining shared class access and avoiding excessive memory occupancy.
Solution Approach 2:
The patent introduces priority thresholds as a parameter to determine when classes should be unloaded. By monitoring class usage patterns and comparing them against predefined priority thresholds, the system can intelligently decide which classes to retain in memory and which to unload, optimizing the balance between memory efficiency and class accessibility.
2Quantity of substance
If classes are dynamically loaded based on requirements, then memory space occupancy is reduced, but class loading and unloading operations increase system complexity
Solution Approach 1:
The patent implements a self-service mechanism where the class loading system automatically monitors class usage, determines when classes should be loaded or unloaded based on priority thresholds, and executes these operations without requiring manual intervention. This automation reduces the operational complexity burden while maintaining memory optimization benefits.
Solution Approach 2:
The system incorporates feedback mechanisms that continuously monitor class usage patterns and adjust loading/unloading decisions accordingly. By using usage information as feedback, the system can adapt its behavior to actual needs, reducing the complexity of manual control while maintaining optimal memory usage.
3Quantity of substance
If classes are unloaded when application is closed, then memory is released, but classes continue to camp on memory during operation regardless of whether they are actively used
Solution Approach 1:
The patent extends the static application-close unloading model to a dynamic operation-time unloading model. Classes are continuously monitored during application operation, and the system dynamically decides when to unload classes based on usage patterns and priority thresholds. This maintains class availability for actively used classes while releasing memory for inactive ones, resolving the contradiction between memory release and class availability.
Data Source
Figure 1a~1b
Figure 2
Figure 3~4a
AI summary
This application provides a class unloading method and an electronic device, and relates to the field of electronic technologies, to dynamically unload a class in an operation process of an application and increase available memory space. A specific solution includes: loading, by an electronic device, n classes after an application is started (201), where n is a positive integer; generating a reference mapping table (202), where the reference mapping table includes a reference relationship between the n classes and m class objects corresponding to the n classes and a dependency relationship between the m class objects corresponding to the n classes, the dependency relationship is used to represent an interdependency mapping relationship between different class objects, and m is a positive integer greater than or equal to n; and unloading a first class of the n classes based on the reference mapping table in an operation process of the application (203).