Shared Physical Memory Reclamation for Background Apps
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In scenarios where application processes and hardware devices share physical memory, if the application process fails to release the memory when it switches to the background, the memory remains occupied, leading to a decrease in available memory for the electronic device.
Innovation Solution
The application process actively requests to reclaim the physical memory by sending commands to a memory processing apparatus, which modifies page tables to release and reallocate memory, ensuring data security and availability.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If the application process shares physical memory with hardware device, then memory usage efficiency is improved, but the physical memory cannot be reclaimed when application switches to background
Solution Approach 1:
The patent implements dynamic memory management by enabling the application process to actively request memory release when switching to background state. The memory processing apparatus dynamically adjusts memory allocation based on application state changes, transitioning from static memory retention to dynamic memory sharing and reallocation.
Solution Approach 2:
The patent establishes a feedback mechanism where the application process sends commands to the memory processing apparatus to indicate when memory can be released. This feedback loop allows the system to monitor application needs and adjust memory allocation accordingly, enabling efficient memory reclamation when applications are inactive.
2Reliability
If the application process does not release physical memory when switched to background, then data availability is maintained, but available memory decreases
Solution Approach 1:
The patent applies preliminary action by having the application process proactively send memory release commands before actually switching to background state. This advance notification allows the memory processing apparatus to prepare for memory reallocation, ensuring data is preserved and memory is efficiently reused without abrupt changes.
Solution Approach 2:
The memory processing apparatus acts as an intermediary between the application process and the physical memory. It receives release commands from the application, manages the memory reallocation process, and ensures proper data handling, thereby mediating between data availability requirements and memory efficiency goals.
3Productivity
If the memory processing apparatus modifies page tables to release memory, then memory can be reallocated, but system complexity increases
Solution Approach 1:
The patent implements self-service by enabling the application process to autonomously send memory release commands based on its own state changes. The application process manages its own memory needs by actively requesting release when switching to background, reducing the burden on the memory processing apparatus and simplifying the overall system architecture.
Data Source
Figure 1~2
Figure 3A
Figure 3B
AI summary
Embodiments of this application provide a memory processing method, an electronic device, and a readable storage medium. In the method, in a scenario in which an application program and a hardware device share a first physical memory, when the application program is switched to a background, the application program sends a first command to a memory processing apparatus, where the first command indicates to release the first physical memory of the application program; and the memory processing apparatus releases the first physical memory in response to the first command. In embodiments of this application, when the application program is switched to the background, and temporarily does not need to use the first physical memory, the application program may actively request to release the first physical memory, to increase an available memory of an electronic device.