Linked List Application Caching Management for iOS Memory Overflow
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The iOS platform's NSCache mechanism lacks a strict memory size limit, leading to potential overflow during new cached data storage, resulting in low storage speed and efficiency due to the lack of controlled memory usage.
Innovation Solution
A linked-list-based method and device for application caching management that dynamically manages memory by creating nodes for cached data, monitoring memory usage, and deleting nodes with the longest time intervals to maintain memory within set limits, ensuring efficient storage and retrieval.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If NSCache memory cache mechanism is used without strict memory size limit, then caching convenience is improved, but memory overflow occurs during new cached data storage resulting in low storage speed and efficiency
Solution Approach 1:
The patent changes the memory management parameter from unlimited to limited by introducing a maximum memory size threshold. When the total cached data size approaches this threshold, the system automatically deletes expired cached data to make space for new data, thereby preventing memory overflow and maintaining high storage efficiency while preserving caching convenience.
Solution Approach 2:
The patent implements self-service by enabling the caching system to automatically manage its own memory usage. The system monitors total cached data size, compares it with the maximum memory size threshold, and autonomously deletes expired data without external intervention, thus preventing memory overflow and maintaining optimal storage performance.
2Device complexity
If new cached data is stored without checking memory limit, then storage operation is simplified, but total memory size may overrun system memory limit causing low storage speed
Solution Approach 1:
The patent applies preliminary action by checking whether the total cached data size plus the size of new data to be stored exceeds the maximum memory size threshold before actually storing the new data. This pre-check prevents memory overflow and ensures that storage operations proceed at high speed without causing system memory limits to be overrun.
Solution Approach 2:
The patent implements feedback by continuously monitoring the total size of cached data and comparing it with the maximum memory size threshold. Based on this feedback, the system determines whether to allow new data storage or to delete expired data first, thereby maintaining optimal storage speed while preventing memory overflow.
3Speed
If cached data is stored without memory size control, then data access speed is maintained, but memory management becomes uncontrolled resulting in potential system memory overflow
Solution Approach 1:
The patent introduces a maximum memory size parameter to control the total amount of cached data. By enforcing this parameter, the system maintains reliable memory management that prevents system memory overflow while preserving fast data access speeds through efficient memory utilization.
Solution Approach 2:
The patent enables the caching system to self-manage memory by automatically deleting expired data when the total cached data size approaches the maximum memory size threshold. This self-service mechanism ensures reliable memory management and prevents system memory overflow without affecting data access speed.
Data Source
AI summary
A linked-list-based method for application caching management is disclosed, the method including: when receiving application cached data, creating a node in a linked list for the cached data and obtaining a memory size of the cached data; obtaining a maximum memory size and a currently occupied memory size of the linked list; adding the memory size of the received cached data to the currently occupied memory size of the linked list to obtain a first memory size; and adding the node to the linked list if the first memory size is smaller than or equal to the maximum memory size. A linked-list-based device for application caching management is also provided.


