Method, device and system for allocating and releasing memory
A memory allocation and memory release technology, applied in the field of memory management, can solve the problems of poor memory allocation and release scalability, frequent memory fragmentation, etc., so as to reduce the search time, reduce the number, and improve the utilization rate.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0047] figure 1 It is the flowchart of the memory allocation method of the specific embodiment of the present invention, such as figure 1 As shown, the method includes the steps of,
[0048]S101, requesting at least two memory heap areas preset with a fixed memory allocation amount from the operating system, and assigning a serial number to each memory heap area in an increasing order of the fixed memory allocation amount;
[0049] The fixed memory allocation amount is arranged in an arithmetic sequence according to a preset arithmetic coefficient;
[0050] The preset fixed memory allocation in the memory heap area can be set according to the preset arithmetic difference coefficient; the arithmetic difference coefficient means that if a sequence starts from the second item, the difference between each item and its previous item The difference is equal to the same constant, and this constant is called the differential coefficient; all allocated memory heap areas assign sequen...
Embodiment 2
[0109] Figure 4 It is a flowchart of a memory release method in a specific embodiment of the present invention. Such as Figure 4 As shown, the method comprises the steps of:
[0110] S401, acquire a memory release request;
[0111] S402, judging whether the memory release length required by the memory release request exceeds the maximum value of the fixed memory allocation preset in the memory heap area, if not, proceed to step S403, and if yes, proceed to step S405;
[0112] S403. Obtain a sequence number according to the length;
[0113] The sequence label is calculated according to the following formula (1), so that the length of the requested memory release is larger than the fixed memory allocation of the previous memory heap area, and smaller than the fixed memory allocation of the current memory heap area,
[0114] i=(A+k) / k (1)
[0115] Wherein, i represents the serial number of the memory heap area matched with the memory release request; A represents the lengt...
Embodiment 3
[0129] The system includes a memory allocation device and a memory release device; the memory allocation device is connected to the memory release device;
[0130] The memory allocation device includes a preset heap module, a first request module, a first judgment module, a heap allocation module and a system allocation module;
[0131] The preset heap area module is connected to the first request module, and is used to request allocation of at least two memory heap areas preset with a fixed memory allocation amount;
[0132] The first request module is connected to the preset heap module and the first judgment module, and is used to obtain a memory allocation request;
[0133] The first judgment module is connected to the first request module, the heap area allocation module and the system allocation module, and is used to determine whether the length of the memory allocated by the memory allocation request exceeds the fixed memory allocation in the memory heap area If not, ...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com