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.

CN105094710AActive Publication Date: 2015-11-25NARI TECH CO LTD +1
4 Cites 7 Cited by

Patent Information

Authority / Receiving Office
CN · China
Current Assignee / Owner
Publication Date
2015-11-25

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The present invention discloses a single-process dynamic storage management method based on a Hash table, which comprises: initializing the Hash table; applying for a dynamic memory; releasing the dynamic memory; carrying out real-time routing inspection; creating an empty Hash table; and storing dynamic storage applying information. In the dynamic memory applying process, related information of applying for the memory is stored into the Hash table and overflow flags are set; in the dynamic memory releasing process, the Hash table is searched, the memory is released if related pointers are searched, or an alarm is given; and in the real-time routing inspection and calling process, whether overflow of the dynamic memory exists or not is judged; by checking overflow flag words in memory areas in Hash table nodes one by one, the sizes of all memory spaces in the Hash table are added, the sum of the memory spaces is stored according to the frequency of storing for once at intervals of one hour, and whether the memory overflow risk exists or not is judged. According to the present invention, progress idle time is used to monitor and check the use condition of the dynamic memory in real time, a monitoring result is sent to a frame by a message queue, the frame takes charge of carrying out organizing and providing an inquiring function, and the single-process dynamic storage management method has wide application prospect.
Need to check novelty before this filing date? Find Prior Art

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...