Virtual Machine Method Unloading to Reduce Memory Footprint
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current Virtual Machine systems face challenges in reducing memory usage during data processing tasks on limited devices, as they require significant memory to store all classes and methods, and existing solutions like paging systems need special-purpose hardware and are not fine-grained enough.
Innovation Solution
Implement a software-based unloading mechanism that analyzes and unloads inactive functions or portions of platform-neutral program code on a function-by-function basis, allowing for more efficient memory management without requiring special hardware, and provides a reloading mechanism for when the functions are needed again.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If all classes and methods are kept loaded in Virtual Machine memory, then execution speed is improved, but memory usage increases significantly on devices with limited storage space
Solution Approach 1:
The patent segments the class loading and unloading operations at the method level rather than requiring entire classes to be loaded or unloaded together. The Virtual Machine maintains a set of loaded methods and can selectively unload individual methods that are no longer needed, while keeping other methods loaded. This fine-grained segmentation allows the system to optimize memory usage by keeping only the necessary methods in memory while maintaining fast execution for those methods.
Solution Approach 2:
The patent implements dynamic method unloading and reloading capabilities. The Virtual Machine can dynamically determine which methods to unload based on current execution needs, and can reload methods when they are needed again. This dynamic approach allows the system to adapt memory usage to current computational needs, keeping frequently used methods loaded while unloading rarely used methods, thus resolving the contradiction between execution speed and memory usage.
2Quantity of substance
If paging systems with special-purpose hardware are used to unload data, then memory usage is reduced, but device complexity increases due to hardware requirements
Solution Approach 1:
The patent replaces the mechanical hardware-based paging system with a software-based method unloading mechanism. Instead of using special-purpose hardware to manage memory pages, the Virtual Machine uses software to track which methods are loaded and can selectively unload individual methods. This substitution eliminates the need for complex hardware circuitry while achieving the same goal of reducing memory usage through software-controlled method unloading and reloading.
3Quantity of substance
If classes are unloaded only when no program code needs them, then memory usage is reduced, but execution time increases due to reloading overhead
Solution Approach 1:
The patent implements preliminary action by maintaining a set of loaded methods that are kept in memory in advance of when they might be needed. The Virtual Machine proactively loads methods into its method set before they are executed, and can keep them loaded even if not currently being used. This preliminary loading prevents the need for time-consuming reloading operations when methods are needed, thus reducing execution time while still allowing memory usage to be optimized by unloading methods that are unlikely to be needed soon.
Data Source
AI summary
A method of performing a processing task in a data processing apparatus is provided that reduces memory usage of the processing task. According to this method a Virtual Machine performs the steps of accessing platform-neutral program code in a function repository, executing the processing task on the Virtual Machine, and analysing at a current execution point, on a function-by-function basis, which functions in the function repository are inactive functions. The Virtual Machine performs software-based unloading from the function repository of at least a portion of platform-neutral program code corresponding to one or more inactive functions. A corresponding virtual machine and data processing apparatus are also provided.


