Single-process dynamic storage management method based on Hash table
A technology of dynamic storage and management methods, applied in multi-programming devices, resource allocation, input/output to record carriers, etc., can solve the problem of real-time monitoring without means, program dynamic memory overflow cannot be detected in real time, and memory overflow code cannot be accurately located. location and other issues, to achieve good application prospects, solve dynamic memory overflow and memory leak problems, and improve debugging and testing efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Current Assignee / Owner
- Publication Date
- 2015-11-25
Smart Images
Figure 1 Figure 2 Figure 3
Abstract
Description
technical field
[0001] The invention belongs to the technical field of dynamic memory management of an embedded system, and in particular relates to a single-process dynamic storage management method based on a hash table. Background technique
[0002] The memory management module of the existing embedded system is mainly responsible for the allocation, recycling and swapping in and out of memory units. Among them, "allocation" is responsible for selecting a suitable memory unit from the free memory unit list when the process applies for a memory unit from the system Assigned to the process; "recycling" is responsible for putting the released memory unit back into the free memory unit list when the process releases the memory unit, and doing appropriate defragmentation; "swapping out" is responsible for not urgent when the physical memory is insufficient Process data or codes are first stored in external memory (disk, etc.), so that the memory units they occupy are freed up ...
Examples
Embodiment Construction
[0027] The present invention will be further described below in conjunction with the accompanying drawings.
[0028] The hash table-based single-process dynamic storage management method of the present invention is used to run on a single application process, occupy the idle time of the application process to monitor and check the dynamic memory usage in real time, and send the monitoring results to the framework program through the message queue, The framework program is responsible for collating and providing queries, such as figure 1 As shown, it specifically includes the following steps,
[0029] Step (1): In the initialization phase of the application process, call the initialization interface of the hash table to create an empty hash table. The hash table includes the maximum number of memory application blocks and the information of each block of memory. Each block of memory The information includes valid flags, the starting address of the requested memory, the size of...