CN103902466A - Internal memory pool capable of being dynamically adjusted - Google Patents

Internal memory pool capable of being dynamically adjusted Download PDF

Info

Publication number
CN103902466A
CN103902466A CN201410134586.0A CN201410134586A CN103902466A CN 103902466 A CN103902466 A CN 103902466A CN 201410134586 A CN201410134586 A CN 201410134586A CN 103902466 A CN103902466 A CN 103902466A
Authority
CN
China
Prior art keywords
internal memory
memory
storage location
routine
array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410134586.0A
Other languages
Chinese (zh)
Inventor
张在理
王倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN201410134586.0A priority Critical patent/CN103902466A/en
Publication of CN103902466A publication Critical patent/CN103902466A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides an internal memory pool capable of being dynamically adjusted and relates to the field of computer internal memory managing mechanisms. The internal memory pool has the advantages that an intermediate manner which is characterized in that internal memory is distributed during use and not immediately released after use is designed, when a program applies for an internal memory unit of similar size, the internal memory applied before can be directly used by the new request, releasing is delayed on the basis of chain tables so as to increase system efficiency, internal memory fragments generated during internal memory use are reduced, internal memory units of different lengths are organized by bidirectional link header arrays, and mutually exclusive access of each chain table is realized by the elements of mutex arrays.

Description

The memory pool that a kind of capable of dynamic regulates
technical field
the present invention relates to calculator memory administrative mechanism, the internal memory that specifically a kind of capable of dynamic regulates, uses suitable redesign to solve the problem that memory usage that frequent application and releasing memory bring and system effectiveness reduce.
Background technology
In operating system now, it is programmer's most thorny issue that the use of internal memory has been become, the release of internal memory and application internal memory length not equal improper use are tended to cause program crashing, memory overflow, also may occur the various strange problems such as the data that cause due to memory overwriting are incorrect.The mechanism such as the automatic Memory recycle of various language are also continually developed out.Even if application and releasing memory that can be correct, when frequently applying for and discharging also to cause following two problems.The one, on the impact of efficiency, application and releasing memory can need to do a lot of processing in inside in operating system, and efficiency is often not high.The 2nd, because Installed System Memory distribution mechanism problem causes, in the time that user asks an internal storage location to be less than a page, system can be on page storage allocation, but in the time that another memory request is greater than the remaining space of last page, system can be distributed the memory headroom of asking on new page, now the remaining space of first page will form fragment, forms after a large amount of memory fragmentations and can cause running efficiency of system to decline, and even causes program not move.Picture send the webserver of result more easily to go wrong for the frequent request Concurrency that receives very much, and the internal memory that exhausts that system can be very fast reduces running efficiency of system gradually, finally can not process request.
Frequent application and releasing memory unit can be to lowering efficiency, increase cpu expense, the expense that can use the abundant internal storage location mode of prior distribution to reduce application and discharge, but the shortcoming of storage allocation unit is we and the uncertain internal storage location size that we will use in advance, if the memory size of frequent demand is far smaller than the internal storage location of prior distribution, can cause the huge waste of internal storage location, if distribute in advance too many memory-to-memory pond simultaneously, when user not can not cause system and application program can not use this partial memory when memory request frequently, cause equally the waste of internal memory.Although the method can solve the problem of RAM fragmentation, but still it not effective solution.
Summary of the invention
By above analysis, it is not best settling mode that the prior distribution of internal memory and used time distribute, so should be by a kind of mid way of design, storage allocation while using a kind of use, the mode of releasing memory immediately not after being used to complete, in the time that program is applied for the internal storage location of similar size again, use directly to new request the internal memory of applying for before, the memory pool mode that realizes a kind of program oneself maintenance of compromise solves the deficiency of above two kinds of problems
Memory pool comprises a Two-way Chain gauge outfit array and each linked list head is carried out to the mutexes array of exclusive reference.Each linked list head and mutexes pairing are used.Each Two-way Chain gauge outfit is that different linked list heads are organized the internal storage location of different length in order to organize the internal storage location that each length is identical, needs exclusive reference, so need corresponding mutexes array due to the deletion of chained list with while adding new storage unit.The length of array of pointers and mutexes array equal in length, it depends on internal storage location scope and the internal storage location length interval of request.Less internal storage location interval can make memory usage higher, but the probability of mutual exclusion will be higher, and efficiency can be lower.
The memory pool that capable of dynamic regulates, has realized initialization, destruction, application, release and scan routine,
Initialization routine is responsible for the initialization of linked list array and mutexes array and the initialization of scanning thread;
Destroy routine, be responsible for destroying intermittent scanning thread, destroy Two-way Chain gauge outfit array and corresponding mutexes array;
Application routine be responsible for first attempts to obtain internal storage location from memory pool chained list, in the time there is no suitable internal storage location from Installed System Memory application;
Discharge routine and be responsible for the internal memory of user's release to be reentered into storage pool, insert in chained list;
Scan routine is responsible for the each chained list of timing scan, searches the internal storage location not using for a long time, and returns to Installed System Memory after discharging;
Storage allocation when use, the mode of releasing memory immediately not after being used to complete, in the time that program is applied for the internal storage location of similar size again, directly gives new request use by the internal memory of application before.
The beneficial effect that the present invention produces is:
Improve system effectiveness as basis with delayed release take chained list, reduce the memory fragmentation that internal memory use procedure produces, realize the internal storage location with Two-way Chain gauge outfit array organization different length, realize the memory pool of the exclusive reference to each chained list with the element of mutexes array, improved the frequent application of program and discharged the problem that causes Efficiency Decreasing and memory fragmentation.
accompanying drawing explanation
Accompanying drawing 1 is memory management routine figure of the present invention.
Embodiment
The memory pool that capable of dynamic regulates, has realized initialization, destruction, application, release and scan routine,
Memory management routine:
Initialization routine needed first to carry out initialized operation before memory pool uses, and structure Two-way Chain gauge outfit array is also constructed corresponding mutexes array, and scanning thread of initialization registration is set scanning thread cycle length.
Destroy routine, be responsible for destroying intermittent scanning thread, destroy Two-way Chain gauge outfit array and corresponding mutexes array.
Internal storage location application, internal memory length l en as required, 2^ (n-1) <len<=2^n, the value of calculating n, using n as linked list head array indexing, check on the chained list of linked list head index and whether have internal storage location, if available free internal storage location, the internal storage location that is 2^n from system application length, if available free unit, chained list is locked, obtain this internal storage location from chained list and use.
Internal storage location discharges routine, the effect that internal storage location discharges routine is that the internal storage location that user is not re-used is put back in memory pool, first to lock to Two-way Chain gauge outfit corresponding to length, and internal storage location is inserted to doubly linked list tail, then discharge chained list lock, realized a kind of time delay releasing memory unit and realize the solution of compromise.
Scanning thread, scanning thread is one-period active thread, cycle can be according to using situation that suitable value is set, internal storage location on all bidirectional pointer chained lists of periodic scanning, check that internal storage location free time discharges this internal storage location in the time that internal storage location free time is greater than given time, internal memory is returned to system.System can continue to use this partial memory, in the time that memory pool is not used fast, is necessary by the rational internal memory time system of returning.Scanning is to be undertaken by linked list head array, first linked list head is locked, then each node in scan chain table, if find that node does not use for a long time, releasing memory unit, internal memory is returned to system, otherwise carried this internal storage location, only then carried out the surface sweeping of next chained list to having scanned a chained list.Each chained list has corresponding mutual exclusion lock, and how single chained list locks and all chained lists do not locked.

Claims (1)

1. the memory pool that capable of dynamic regulates, is characterized in that having realized initialization, destruction, application, release and scan routine,
Initialization routine is responsible for the initialization of linked list array and mutexes array and the initialization of scanning thread;
Destroy routine, be responsible for destroying intermittent scanning thread, destroy Two-way Chain gauge outfit array and corresponding mutexes array;
Application routine be responsible for first attempts to obtain internal storage location from memory pool chained list, in the time there is no suitable internal storage location from Installed System Memory application;
Discharge routine and be responsible for the internal memory of user's release to be reentered into storage pool, insert in chained list;
Scan routine is responsible for the each chained list of timing scan, searches the internal storage location not using for a long time, and returns to Installed System Memory after discharging;
Storage allocation when use, the mode of releasing memory immediately not after being used to complete, in the time that program is applied for the internal storage location of similar size again, directly gives new request use by the internal memory of application before.
CN201410134586.0A 2014-04-04 2014-04-04 Internal memory pool capable of being dynamically adjusted Pending CN103902466A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410134586.0A CN103902466A (en) 2014-04-04 2014-04-04 Internal memory pool capable of being dynamically adjusted

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410134586.0A CN103902466A (en) 2014-04-04 2014-04-04 Internal memory pool capable of being dynamically adjusted

Publications (1)

Publication Number Publication Date
CN103902466A true CN103902466A (en) 2014-07-02

Family

ID=50993800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410134586.0A Pending CN103902466A (en) 2014-04-04 2014-04-04 Internal memory pool capable of being dynamically adjusted

Country Status (1)

Country Link
CN (1) CN103902466A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106970882A (en) * 2017-03-10 2017-07-21 浙江大学 A kind of easy extension page architecture based on Linux big page internal memories
CN108762919A (en) * 2018-05-17 2018-11-06 桂林长海发展有限责任公司 A kind of program internal memory processing system and method
CN109669780A (en) * 2018-12-25 2019-04-23 上海极链网络科技有限公司 A kind of video analytic method and system
CN115237607A (en) * 2022-09-21 2022-10-25 北京中科网威信息技术有限公司 Memory configuration method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5675790A (en) * 1993-04-23 1997-10-07 Walls; Keith G. Method for improving the performance of dynamic memory allocation by removing small memory fragments from the memory pool
US20070118712A1 (en) * 2005-11-21 2007-05-24 Red Hat, Inc. Cooperative mechanism for efficient application memory allocation
CN1987792A (en) * 2006-12-20 2007-06-27 金魁 Application system for high grade multiple line distance management
CN102915276A (en) * 2012-09-25 2013-02-06 武汉邮电科学研究院 Memory control method for embedded systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5675790A (en) * 1993-04-23 1997-10-07 Walls; Keith G. Method for improving the performance of dynamic memory allocation by removing small memory fragments from the memory pool
US20070118712A1 (en) * 2005-11-21 2007-05-24 Red Hat, Inc. Cooperative mechanism for efficient application memory allocation
CN1987792A (en) * 2006-12-20 2007-06-27 金魁 Application system for high grade multiple line distance management
CN102915276A (en) * 2012-09-25 2013-02-06 武汉邮电科学研究院 Memory control method for embedded systems

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106970882A (en) * 2017-03-10 2017-07-21 浙江大学 A kind of easy extension page architecture based on Linux big page internal memories
CN106970882B (en) * 2017-03-10 2020-04-14 浙江大学 Easily-extensible page framework based on Linux large-page memory
CN108762919A (en) * 2018-05-17 2018-11-06 桂林长海发展有限责任公司 A kind of program internal memory processing system and method
CN109669780A (en) * 2018-12-25 2019-04-23 上海极链网络科技有限公司 A kind of video analytic method and system
CN109669780B (en) * 2018-12-25 2020-02-14 上海极链网络科技有限公司 Video analysis method and system
CN115237607A (en) * 2022-09-21 2022-10-25 北京中科网威信息技术有限公司 Memory configuration method and device, electronic equipment and storage medium
CN115237607B (en) * 2022-09-21 2022-12-13 北京中科网威信息技术有限公司 Memory configuration method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
DE102013022712B4 (en) Virtual memory structure for coprocessors that have memory allocation limits
Kissinger et al. KISS-Tree: smart latch-free in-memory indexing on modern architectures
DE102011076895B4 (en) Cache coherence protocol for persistent storage
US20150378618A1 (en) Memory allocation buffer for reduction of heap fragmentation
DE102008062044B4 (en) 1In-memory, in-page directory cache coherency configuration
US11042477B2 (en) Memory management using segregated free lists
CN103902466A (en) Internal memory pool capable of being dynamically adjusted
US20120311298A1 (en) Mount-time unmapping of unused logical addresses in non-volatile memory systems
DE112011103559T5 (en) Vector gather buffer for multiple address vector loads
DE102010034555A1 (en) Provide state memory in a system management mode processor
DE202015009260U1 (en) Efficient data readings from distributed storage systems
DE112011101391T5 (en) GPU-enabled database systems
US11526960B2 (en) GPU-based data join
CN101493787A (en) Internal memory operation management method and system
DE102015013125A1 (en) Apparatus, systems and methods for providing a storage efficient cache
Cieslewicz et al. Data partitioning on chip multiprocessors
DE202017104850U1 (en) Redistributing data in a distributed computer system
DE102020132140A1 (en) Pipelines for secure multithreaded execution
US10275289B2 (en) Coexistence of message-passing-like algorithms and procedural coding
DE102012222391B4 (en) Multichannel Time Slice Groups
US10901639B2 (en) Memory allocation in multi-core processors
US10740317B2 (en) Using message-passing with procedural code in a database kernel
CN104063328A (en) Memory management method for alleviating fragment generation
US10810124B2 (en) Designations of message-passing worker threads and job worker threads in a physical processor core
EP3188028B1 (en) Buffer management method and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140702