OS Memory Stack Management for Unused Data Recovery
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In electronic apparatuses, memory areas assigned to user stacks often contain unused data after initialization, leading to inefficient memory usage as these areas are not reclaimed, thereby reducing available memory for other processes.
Innovation Solution
The operating system (OS) discards memory areas containing unused data from user stacks by identifying them using stack pointers during transitions from user mode to kernel mode, allowing these areas to be reused by other processes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the memory area is assigned to the user stack during process initialization, then the process can execute functions properly, but the memory area is wasted after initialization when data is not used
Solution Approach 1:
The patent applies dynamic memory management by adjusting the stack pointer (SP) to reflect the actual amount of data in use. The SP is dynamically modified during process execution and updated when transitioning between user mode and kernel mode, allowing the memory allocation to adapt to actual needs rather than remaining static at the initial allocation size.
Solution Approach 2:
The patent implements memory recovery by discarding unused stack data when the process transitions to kernel mode. The OS identifies unused data based on the SP position and releases this memory back to the system, making it available for other processes. This ensures memory is recovered promptly rather than being held indefinitely.
2Adaptability or versatility
If the stack size is increased during function calls, then the process can handle complex operations, but the available memory area for other processes is decreased
Solution Approach 1:
The patent enables dynamic adjustment of stack memory allocation based on actual usage. The SP is modified to reflect the true amount of stack data in use, allowing the system to allocate more memory during complex function calls when needed and release it when not needed, creating a dynamic balance between individual process needs and overall system availability.
Solution Approach 2:
The patent makes memory universally available by releasing stack memory back to the general pool when not in use. The same physical memory locations can be reused by different processes at different times, increasing overall system utility without compromising any single process's ability to allocate sufficient memory when required.
3Stability of the object's composition
If the memory area is not reclaimed after initialization, then the process maintains consistent memory allocation, but memory utilization efficiency is reduced
Solution Approach 1:
The patent introduces dynamic memory management that updates the SP to reflect actual data usage. This dynamic adjustment maintains stability for the portion of memory that is actually needed while allowing the system to optimize overall utilization by releasing unused portions, resolving the conflict between individual process stability and system-wide efficiency.
Solution Approach 2:
The process essentially manages its own memory through the SP mechanism, which automatically tracks and reports the actual amount of stack data in use. The OS uses this self-reported information to make intelligent decisions about memory reclamation, creating a self-service system that balances stability and efficiency without requiring complex external management.
Data Source
AI summary
An electronic apparatus including a storage; a processor configured to execute a program including an OS and application program stored in the storage; and a memory configured to load and store the program based on execution of the program, the processor being configured to control the OS to, based on an execution of a process of the application program, create a user stack corresponding to at least one task of the process and store data of the user stack in a predetermined area of the memory; based on a predetermined event being generated in a state which the process is executed, stop change in the data of the predetermined area; discard an area in which data used in a procedure of initiating the process among the stored data is stored, in the predetermined area; and based on a work corresponding to the predetermined event being completed, continuously perform the operation.


