Memory pool management method

A management method and memory pool technology, applied in the field of memory pool management, can solve problems such as program inoperability, waste of memory units, repeated release of memory, etc., and achieve the effects of easy analysis and location of problem codes, improved allocation performance, and small synchronization particles

Active Publication Date: 2019-04-16
SHENGQU INFORMATION TECH SHANGHAI
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

One is the impact on efficiency. Applying and releasing memory requires a lot of processing inside the operating system, and the efficiency is often not high.
The second is due to the problem of the system memory allocation mechanism. When the user requests a memory unit smaller than one page, the system will allocate memory on the memory page, but when another memory request is larger than the remaining space of the previous page, the system will allocate memory on the new page. The requested memory space is allocated on the page. At this time, the remaining space of the first page will be fragmented. After a large number of memory fragments are formed, the operating efficiency of the system will decrease, and even the program cannot run.
The web server used to frequently receive requests and send processing results is more prone to problems, and the system will quickly run out of memory, gradually reducing system operating efficiency, and finally unable to process requests
[0003] Frequent application and release of memory units will reduce efficiency and increase CPU overhead. You can reduce the overhead of application and release by allocating enough memory units in advance, but the disadvantage of allocating memory units in advance is that we are not sure the size of the memory unit we will use , if the frequently requested memory size is much smaller than the memory unit allocated in advance, it will cause a huge waste of memory units. At the same time, if too much memory is allocated in advance to the memory pool, when the user does not have frequent memory requests, it will cause system and application problems. This part of the memory cannot be used, which also causes a waste of memory
In addition, in actual development, problems such as repeated memory release, memory out-of-bounds, and memory out-of-bounds problems often occur, resulting in server instability, crashes, and difficult positioning

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Memory pool management method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0019] The specific implementation manner of the present invention will be described in more detail below with reference to schematic diagrams. Advantages and features of the present invention will be apparent from the following description and claims. It should be noted that all the drawings are in a very simplified form and use imprecise scales, and are only used to facilitate and clearly assist the purpose of illustrating the embodiments of the present invention.

[0020] The embodiment of the present invention provides a memory pool management method, specifically, as figure 1 shown, including the following steps:

[0021] S1: Divide the memory pool into multiple secondary memory pools of different sizes, and each secondary memory pool corresponds to different memory linked lists according to different alignment lengths.

[0022] In this embodiment, the memory pool is divided into three secondary memory pools of different sizes, namely: the first secondary memory pool, t...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The present invention provides a memory pool management method. The memory pool management method comprises the steps of dividing a memory pool into a plurality of sub memory pools of different sizes, the sub memory pools being corresponding to different memory lists according to different alignment lengths; selecting a sub memory pool according to required memory space size, and allocating memory according to the alignment length corresponding to the selected sub memory pool; and adding a header structure before the allocated memory space, the header structure being used for recording the size and usage state of the allocated memory space. Each list is separate-thread-safe, synchronous particles are smaller, synchronization is reduced correspondingly, and allocation performance is improved. Validity of memory usage is determined through values in the header structure, call stack is generated, logs are recorded, and problem codes can be analyzed and positioned conveniently.

Description

technical field [0001] The invention relates to the field of computer applications, in particular to a memory pool management method. Background technique [0002] In today's operating system, the use of memory has become the most difficult problem for programmers. Improper use of memory release and application memory length will often cause program crashes, memory out of bounds, and may also occur due to memory out of bounds. Various weird problems such as incorrect data. Mechanisms such as automatic memory recycling in various languages ​​have also been continuously developed. Even if the memory can be applied and released correctly, frequent application and release may cause the following two problems. One is the impact on efficiency. Applying and releasing memory requires a lot of processing inside the operating system, and the efficiency is often not high. The second is due to the problem of the system memory allocation mechanism. When the user requests a memory unit...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F12/0842
CPCG06F12/0842
Inventor 杜利波
Owner SHENGQU INFORMATION TECH SHANGHAI
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products