Video App Keepalive Mechanism for Background Memory Management
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Video applications often experience memory shortages, leading to the clearing of processes when switched to the background, resulting in significant time consumption to restore playback state upon returning to the foreground, which negatively impacts user experience.
Innovation Solution
A method for keeping video applications alive in the background by determining memory usage and system pressure levels, applying a keepalive policy to maintain the application's process, and reallocating audio focus when switched back to the foreground, ensuring seamless video playback.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If the system clears the video application process to ensure normal system operation, then system memory usage is improved, but the time required to restore playback state increases significantly
Solution Approach 1:
The system performs preliminary actions by keeping the video application process alive in the background before the user needs to return to it. The application maintains its playback state and readiness in a suspended state, so when the user switches back, the video can resume immediately without requiring process restoration. This preliminary maintenance of application state resolves the contradiction by preventing the need for time-consuming process restarts while allowing memory to be freed from fully active applications.
Solution Approach 2:
The system dynamically adjusts application state management based on memory pressure conditions. When memory is sufficient, applications run fully in the foreground. When memory becomes constrained, the system transitions applications to a kept-alive background state that preserves essential playback state information. This dynamic state management allows the system to adapt between memory optimization and playback continuity, resolving the contradiction between memory usage and restoration time.
2Loss of time
If the video application is kept alive in the background to maintain playback state, then the time to restore playback state is reduced, but system memory consumption increases
Solution Approach 1:
The system extracts and separates the essential playback state information from the full application process. Instead of keeping the entire application fully loaded in memory, the system extracts only the critical playback state data (such as video position, buffer state, and playback metadata) and maintains this minimal state information in the background. This extraction allows the application to be kept alive for quick resumption while consuming significantly less memory than a fully active process.
Solution Approach 2:
The system changes the parameter of application state from fully active to suspended kept-alive state. In this transformed state, the application process is maintained with modified memory characteristics - essential state information is preserved while non-essential components are suspended or minimized. This parameter change allows the system to maintain playback continuity (reducing restoration time) while optimizing memory consumption by preventing the application from occupying full active process memory.
3Quantity of substance
If the application process is cleared to manage memory resources, then memory efficiency is improved, but user experience deteriorates due to repeated operations
Solution Approach 1:
The system performs preliminary maintenance of the video application's playback state in the background before the user needs to return to it. By keeping the application process alive with its state preserved, the system eliminates the need for users to perform repeated operations such as restarting the application, re-searching for videos, or re-watching advertisements. This preliminary state preservation directly improves ease of operation while maintaining memory efficiency through proper state management.
Solution Approach 2:
The system introduces an intermediary state - the kept-alive background state - that mediates between the cleared process state and the desired playback continuation. This intermediary state preserves the essential playback information without requiring the full application to be actively running, thus bridging the gap between memory efficiency and user experience. The intermediary state allows the system to acknowledge memory constraints while preventing user-facing operational repetitions.
Data Source
Figure 1A
Figure 1B
Figure 1C
AI summary
This application provides a video application keepalive method and an electronic device. The video application keepalive method includes: when running memory usage of a system exceeds a first threshold, the electronic device determines whether the first application is of a video type. In a case in which the first application is of a video type, it is determined whether the first application is in a video hold state. If the first application is in a video hold state, and the application meets a ranking condition, the electronic device keeps the first application alive within keepalive duration.