CN110647397B - Method and system for dynamically controlling total memory amount based on block memory - Google Patents

Method and system for dynamically controlling total memory amount based on block memory Download PDF

Info

Publication number
CN110647397B
CN110647397B CN201910872169.9A CN201910872169A CN110647397B CN 110647397 B CN110647397 B CN 110647397B CN 201910872169 A CN201910872169 A CN 201910872169A CN 110647397 B CN110647397 B CN 110647397B
Authority
CN
China
Prior art keywords
memory
software module
current
amount
locking
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.)
Active
Application number
CN201910872169.9A
Other languages
Chinese (zh)
Other versions
CN110647397A (en
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.)
Beijing Fangyan Juxing Technology Co ltd
Original Assignee
Beijing Fangyan Juxing Technology 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 Beijing Fangyan Juxing Technology Co ltd filed Critical Beijing Fangyan Juxing Technology Co ltd
Priority to CN201910872169.9A priority Critical patent/CN110647397B/en
Publication of CN110647397A publication Critical patent/CN110647397A/en
Application granted granted Critical
Publication of CN110647397B publication Critical patent/CN110647397B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a dynamic control method and a system for total memory amount based on a block memory, wherein in the initialization stage of a software module, the software module applies for locking the memory, and the locked memory is determined by a user expected value and a system actual memory; after the locking memory corresponding to the software module is used up, the software module applies for re-locking an extended memory, the extended memory is compared with the remaining lockable memory, and then whether the existing memory which is not used by other software modules is called is determined until the software module successfully expands the memory, otherwise, the application of re-locking failure is declared. The invention can dynamically adjust the memory allocation proportion of each module under the limit of the upper limit of the total memory according to the actual operation condition of each software module, thereby improving the total utilization rate of the memory as much as possible and enabling the software to operate more functions as much as possible.

Description

Method and system for dynamically controlling total memory amount based on block memory
Technical Field
The application relates to the field of terminal software of the Internet of things, in particular to a block memory-based dynamic control method and system for total memory.
Background
The block memory management scheme usually divides the total memory into a plurality of memory pools of different sizes according to predefined sizes. And in the memory application stage, upward fitting is carried out according to the size of the actually applied memory, and memory blocks are allocated from the corresponding memory pool. In the above scheme, it is usually necessary to determine the total amount of the memory in advance, and determine the division ratio of the memory blocks with different sizes in advance according to the actual usage environment.
The terminal of the internet of things comprises various different devices, the resource difference of the different devices is huge, and the use frequency of each sub-function of the same device under different application scenes is also greatly different. Therefore, the total memory usage amount and the proportion of the memory used by each module are difficult to determine in advance, so that the allocation of the software processing memory of each device is difficult to adjust, and the above block memory management scheme is difficult to apply to general internet of things devices.
How to adjust the memory allocation mechanism based on the block memory is a key problem to be solved at present.
Disclosure of Invention
It is an object of the present application to overcome the above problems or to at least partially solve or mitigate the above problems.
According to an aspect of the present application, a method for dynamically controlling the total amount of memory based on a block memory is provided, wherein the method for allocating memory to each software module batch by batch respectively comprises the following steps:
In the initialization stage of the software module, the software module applies for locking a memory, and the locked memory is determined by a user expected value and a system actual memory;
after the locking memory corresponding to the software module is used up, the software module applies for re-locking an extended memory, the extended memory is compared with the remaining lockable memory, and then whether the existing memory which is not used by other software modules is called is determined until the software module successfully expands the memory, otherwise, the application of re-locking failure is declared.
Preferably, in the initialization phase of the software module, the software module applies for locking the memory, and the memory locking process in this phase includes:
taking half of the total amount of the current unlocked memory as the upper limit of the current instance locked memory amount of the software module, comparing the upper limit of the current instance locked memory amount with the user expected value of the software module, and taking the smaller value of the upper limit and the user expected value as the actual instance locked memory amount of the software module, namely the locked memory initially applied by the software module.
Preferably, after the locked memory corresponding to the software module is used up, the software module applies for re-locking an extended memory, and the process of re-locking the extended memory includes:
Calculating the current unlocked memory amount, comparing the calculated current unlocked memory amount with the current minimum expansion unit memory amount of the software module, and if the current unlocked memory amount is not less than the minimum expansion unit memory amount, re-locking the memory according to the current unlocked memory amount to declare that the memory expansion of the current software module is successful; otherwise, the unlocking call of the memory which is not used by the existing other software modules is entered.
Preferably, the unlocking call to the existing memory unused by other software modules includes:
other existing software modules are subjected to increasing sequencing according to the memory utilization rate, and half of the unused memory amount of each software module is unlocked in sequence from the software module with the lowest memory utilization rate;
and if the current unlocked memory amount is not less than the minimum expansion unit memory amount, the memory is locked again according to the current unlocked memory amount, the memory expansion success of the current software module is declared, otherwise, the calculation of the current unlocked memory amount and the comparison of the current unlocked memory amount and the minimum expansion unit memory amount of the current software module are carried out again after the unused memory of the next existing software module is unlocked continuously until the memory expansion of the current software module succeeds or one round of unlocking of the unused memories of all the existing software modules is completed.
Preferably, if a round of unlocking of unused memories of all existing software modules is completed and the memory expansion of the current software module is still unsuccessful, declaring that the memory expansion application of the current software module fails.
According to another aspect of the present application, there is provided a system for dynamically controlling the total amount of memory based on block memory, which is used for allocating memory to each software module batch by batch respectively, and includes:
an initial application unit 101 configured to apply for a locked memory by a software module in an initialization stage of the software module, where the locked memory is determined by a user expected value and a system actual memory;
the extended application unit 102 is configured to, after the locked memory corresponding to the software module is used up, the software module applies for re-locking an extended memory, and after the extended memory is compared with the remaining lockable memory, it is determined whether to call an existing memory that is not used by another software module until the software module successfully performs memory extension, otherwise, the software module quits from declaring that the application of re-locking fails.
Preferably, in the initial application unit 101, in the initialization phase of the software module, the software module applies for locking the memory, and the memory locking process in this phase includes:
Taking half of the total amount of the current unlocked memory as the upper limit of the current instance locked memory amount of the software module, comparing the upper limit of the current instance locked memory amount with the user expected value of the software module, and taking the smaller value of the upper limit and the user expected value as the actual instance locked memory amount of the software module, namely the locked memory initially applied by the software module.
Preferably, in the extension application unit 102, after the locked memory corresponding to the software module is used up, the software module applies for re-locking an extension memory, and re-locking the extension memory, where the extension application unit 102 includes:
a primary expansion unit 201 configured to calculate a current unlocked memory amount, and compare the calculated current unlocked memory amount with a minimum expansion unit memory amount of a current software module, if the current unlocked memory amount is not less than the minimum expansion unit memory amount, relock the memory according to the current unlocked memory amount, and declare that the memory expansion of the current software module is successful; otherwise, the unlocking call of the memory which is not used by the existing other software modules is entered.
Preferably, the extension application unit 102 further includes a secondary extension unit 202, configured to unlock and call an existing memory that is not used by another software module, where the processing procedure includes:
Other existing software modules are subjected to increasing sequencing according to the memory utilization rate, and half of the unused memory amount of each software module is unlocked in sequence from the software module with the lowest memory utilization rate;
and if the current unlocked memory amount is not less than the minimum expansion unit memory amount, the memory is locked again according to the current unlocked memory amount, the memory expansion success of the current software module is declared, otherwise, the calculation of the current unlocked memory amount and the comparison of the current unlocked memory amount and the minimum expansion unit memory amount of the current software module are carried out again after the unused memory of the next existing software module is unlocked continuously until the memory expansion of the current software module succeeds or one round of unlocking of the unused memories of all the existing software modules is completed.
Preferably, if a round of unlocking of unused memories of all existing software modules is completed and the memory expansion of the current software module is still unsuccessful, declaring that the memory expansion application of the current software module fails.
According to yet another aspect of the application, there is provided a computing device comprising a memory, a processor and a computer program stored in the memory and executable by the processor, wherein the processor when executing the computer program implements the method as described above.
According to yet another aspect of the application, a computer-readable storage medium, preferably a non-volatile readable storage medium, is provided, in which a computer program is stored which, when being executed by a processor, carries out the method as described above.
According to yet another aspect of the application, there is provided a computer program product comprising computer readable code which, when executed by a computer device, causes the computer device to perform the method described above.
According to the method and the system for dynamically controlling the total memory amount based on the block memory, the memory is locked for each module according to the empirical value, namely the expected value of a user, through a pre-allocation mechanism for the first time, the allocation size of each module is consistent with the actual size, an upward fitting process does not exist, the using efficiency of the block memory is higher, each module has the minimum allocation guarantee, the memory can be reduced according to the using proportion of the memory of the module after the total memory amount is exhausted, the whole memory utilization rate can be improved, and the frequency of mutually preempting the memory among the modules can be reduced. The method and the device can dynamically adjust the memory allocation proportion of each module under the limit of the upper limit of the total memory according to the actual operation condition of each software module, so as to improve the total utilization rate of the memory as much as possible and enable the software to operate more functions as much as possible.
The above and other objects, advantages and features of the present application will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, as illustrated in the accompanying drawings.
Drawings
Some specific embodiments of the present application will be described in detail hereinafter by way of illustration and not limitation with reference to the accompanying drawings. The same reference numbers in the drawings identify the same or similar elements or components. Those skilled in the art will appreciate that the drawings are not necessarily drawn to scale. In the drawings:
fig. 1 is a flowchart illustrating memory locking performed in an initialization stage of a software module in a method for dynamically controlling the total amount of memory based on a block memory according to another embodiment of the present application;
fig. 2 is a flowchart illustrating a software module extended memory application in a method for dynamically controlling the total memory amount based on a block memory according to another embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a system for dynamically controlling the total amount of memory based on a block memory according to an embodiment of the present disclosure;
FIG. 4 is a block diagram of a computing device according to another embodiment of the present application;
fig. 5 is a diagram of a computer-readable storage medium structure according to another embodiment of the present application.
Detailed Description
First, several concepts related to memory allocation, especially in block memories, are described in the following embodiments:
1. ITEM: the size of the memory required by each data unit of a certain software module is represented, namely, the minimum unit of the memory used by the module.
2. BLOCK: the size of the memory allocated to a certain software module by the memory management module at a time is equal to the size of one or more ITEMs. Namely, the software module applies for the minimum unit of the memory from the memory management.
3. Locking the memory: indicating the total amount of memory that a software module has subscribed to the memory management module.
4. Using a memory: indicating the total amount of memory that a software module has requested for use.
The memory management manages the memory BLOCK according to two granularities of BLOCK and ITEM. Each software module may include a plurality of BLOCKs under the memory management structure, and a plurality of ITEMs may be encapsulated under each BLOCK structure. The software module applies for the memory BLOCK from the system by using the BLOCK as a unit, and then divides the BLOCK into a plurality of ITEMs for the user to use.
This embodiment provides a method for dynamically controlling the total amount of memory based on a block memory, in which allocating memory to each software module batch by batch respectively includes:
in the software module initialization stage, a software module applies for locking a memory, wherein the locked memory is determined by a user expected value and a system actual memory;
After the locking memory corresponding to the software module is used up, the software module applies for re-locking an extended memory, the extended memory is compared with the remaining lockable memory, and then whether the existing memory which is not used by other software modules is called is determined until the software module successfully expands the memory, otherwise, the application of re-locking failure is declared.
As shown in fig. 1, in the initialization stage of the software module, the software module applies for locking the memory, and the memory locking process in this stage includes:
respectively calculating or acquiring a user expected memory and a residual available memory (the total amount of the current unlocked memory);
taking half of the total amount of the current unlocked memory as the upper limit of the current instance locked memory amount of the software module, comparing the upper limit of the current instance locked memory amount with the user expected value of the software module, taking the smaller value of the upper limit and the lower limit as the actual instance locked memory amount of the software module, and determining the lockable memory, namely the locked memory initially applied by the software module;
the initialization is successful.
As shown in fig. 2, after the locked memory corresponding to the software module is used up, that is, the memory allocation from the locked memory of the software module has failed, the software module applies to re-lock an extended memory, and the process of re-locking the extended memory includes:
Calculating the current unlocked memory amount, comparing the calculated current unlocked memory amount with the current minimum expansion unit memory amount of the software module, if the current unlocked memory amount is not less than the minimum expansion unit memory amount, indicating that the expansion condition is met, re-locking the memory according to the current unlocked memory amount, declaring that the memory of the current software module is successfully expanded, and successfully applying; otherwise, the unlocking call of the memory which is not used by the existing other software modules is entered.
Preferably, the unlocking call to the existing memory unused by other software modules includes:
the method comprises the steps that other existing software modules are subjected to ascending sequencing according to the memory utilization rate, namely, a plurality of software modules capable of being unlocked are obtained as sub-modules, and half of the unused memory amount of each software module is unlocked in sequence from the software module with the lowest memory utilization rate;
and if the current unlocked memory amount is not less than the minimum expansion unit memory amount, the memory is locked again according to the current unlocked memory amount, the memory expansion success of the current software module is declared, otherwise, the calculation of the current unlocked memory amount and the comparison of the current unlocked memory amount and the minimum expansion unit memory amount of the current software module are carried out again after the unused memory of the next existing software module is unlocked continuously until the memory expansion of the current software module succeeds or one round of unlocking of the unused memories of all the existing software modules is completed.
Preferably, if the memory expansion of the current software module is still unsuccessful after a round of unlocking of the unused memory of all the existing software modules is completed, the failure of applying for expanding the memory of the current software module is declared.
Based on the same inventive concept, as shown in fig. 3, this embodiment further provides a system for dynamically controlling the total amount of memory based on a block memory, which is used to allocate memory to each software module batch by batch, and includes:
an initial application unit 101 configured to apply for a locked memory by a software module in an initialization stage of the software module, where the locked memory is determined by a user expected value and a system actual memory;
the extended application unit 102 is configured to, after the locked memory corresponding to the software module is used up, the software module applies for re-locking an extended memory, and after the extended memory is compared with the remaining lockable memory, it is determined whether to call an existing memory that is not used by another software module until the software module successfully performs memory extension, otherwise, the software module quits from declaring that the application of re-locking fails.
Preferably, in the initial application unit 101, in the initialization phase of the software module, the software module applies for locking the memory, and the memory locking process in this phase includes:
Taking half of the total amount of the current unlocked memory as the upper limit of the current instance locked memory amount of the software module, comparing the upper limit of the current instance locked memory amount with the user expected value of the software module, and taking the smaller value of the upper limit and the user expected value as the actual instance locked memory amount of the software module, namely the locked memory initially applied by the software module.
Preferably, in the extension application unit 102, after the locked memory corresponding to the software module is used up, the software module applies for re-locking an extension memory, and re-locking the extension memory, where the extension application unit 102 includes:
a primary expansion unit 201 configured to calculate a current unlocked memory amount, and compare the calculated current unlocked memory amount with a minimum expansion unit memory amount of a current software module, if the current unlocked memory amount is not less than the minimum expansion unit memory amount, relock the memory according to the current unlocked memory amount, and declare that the memory expansion of the current software module is successful; otherwise, the unlocking call of the memory which is not used by the existing other software modules is entered.
Preferably, the extension application unit 102 further includes a secondary extension unit 202, configured to unlock and call an existing memory that is not used by another software module, where the processing procedure includes:
Other existing software modules are subjected to increasing sequencing according to the memory utilization rate, and half of the unused memory amount of each software module is unlocked in sequence from the software module with the lowest memory utilization rate;
and if the current unlocked memory amount is not less than the minimum expansion unit memory amount, the memory is locked again according to the current unlocked memory amount, the memory expansion success of the current software module is declared, otherwise, the calculation of the current unlocked memory amount and the comparison of the current unlocked memory amount and the minimum expansion unit memory amount of the current software module are carried out again after the unused memory of the next existing software module is unlocked continuously until the memory expansion of the current software module succeeds or one round of unlocking of the unused memories of all the existing software modules is completed.
Preferably, if the memory expansion of the current software module is still unsuccessful after a round of unlocking of the unused memory of all the existing software modules is completed, the failure of applying for expanding the memory of the current software module is declared.
According to yet another aspect of the application, there is provided a computing device comprising a memory, a processor and a computer program stored in the memory and executable by the processor, wherein the processor implements the method as described above when executing the computer program.
According to yet another aspect of the application, a computer-readable storage medium, preferably a non-volatile readable storage medium, is provided, having stored therein a computer program which, when executed by a processor, implements a method as described above.
According to yet another aspect of the application, there is provided a computer program product comprising computer readable code which, when executed by a computer device, causes the computer device to perform the method described above.
According to the method and the system for dynamically controlling the total memory amount based on the block memory, the memory is locked for each module according to the empirical value, namely the expected value of a user, through a pre-allocation mechanism for the first time, the allocation size of each module is consistent with the actual size, an upward fitting process does not exist, the using efficiency of the block memory is higher, each module has the minimum allocation guarantee, the memory can be reduced according to the using proportion of the memory of the module after the total memory amount is exhausted, the whole memory utilization rate can be improved, and the frequency of mutually preempting the memory among the modules can be reduced. The invention can dynamically adjust the memory allocation proportion of each module under the limit of the upper limit of the total memory according to the actual operation condition of each software module, thereby improving the total utilization rate of the memory as much as possible and enabling the software to operate more functions as much as possible.
The above and other objects, advantages and features of the present application will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Embodiments also provide a computing device, referring to fig. 4, comprising a memory 1120, a processor 1110 and a computer program stored in said memory 1120 and executable by said processor 1110, the computer program being stored in a space 1130 for program code in the memory 1120, the computer program, when executed by the processor 1110, implementing the method steps 1131 for performing any of the methods according to the invention.
The embodiment of the application also provides a computer readable storage medium. Referring to fig. 5, the computer readable storage medium comprises a storage unit for program code provided with a program 1131' for performing the steps of the method according to the invention, which program is executed by a processor.
The embodiment of the application also provides a computer program product containing instructions. Which, when run on a computer, causes the computer to carry out the steps of the method according to the invention.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed by a computer, cause the computer to perform, in whole or in part, the procedures or functions described in accordance with the embodiments of the application. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be understood by those skilled in the art that all or part of the steps in the method for implementing the above embodiments may be implemented by a program, and the program may be stored in a computer-readable storage medium, where the storage medium is a non-transitory medium, such as a random access memory, a read only memory, a flash memory, a hard disk, a solid state disk, a magnetic tape (magnetic tape), a floppy disk (floppy disk), an optical disk (optical disk), and any combination thereof.
The above description is only for the preferred embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (6)

1. A dynamic control method for total memory amount based on block memory is used for allocating memory to each software module batch by batch respectively, and comprises the following steps:
in the initialization stage of the software module, the software module applies for locking a memory, and the locked memory is determined by a user expected value and a system actual memory;
after the locking memory corresponding to the software module is used up, the software module applies for re-locking an extended memory, the extended memory is compared with the remaining lockable memory, and then whether the existing unused memory of other software modules is called is determined until the software module successfully expands the memory, otherwise, the software module quits, and declares that the application of re-locking fails;
after the locked memory corresponding to the software module is used up, the software module applies for re-locking an expanded memory, and the process of re-locking the expanded memory comprises the following steps:
Calculating the current unlocked memory amount, comparing the calculated current unlocked memory amount with the current minimum expansion unit memory amount of the software module, and if the current unlocked memory amount is not less than the minimum expansion unit memory amount, re-locking the memory according to the current unlocked memory amount to declare that the memory expansion of the current software module is successful; otherwise, unlocking and calling the unused memory of other existing software modules;
the unlocking call of the existing unused memory of other software modules comprises the following steps:
other existing software modules are subjected to increasing sequencing according to the memory utilization rate, and half of the unused memory amount of each software module is unlocked in sequence from the software module with the lowest memory utilization rate;
and if the current unlocked memory amount is not less than the minimum expansion unit memory amount, the memory is locked again according to the current unlocked memory amount, the memory expansion success of the current software module is declared, otherwise, the calculation of the current unlocked memory amount and the comparison of the current unlocked memory amount and the minimum expansion unit memory amount of the current software module are carried out again after the unused memory of the next existing software module is unlocked continuously until the memory expansion of the current software module succeeds or one round of unlocking of the unused memories of all the existing software modules is completed.
2. The method of claim 1, wherein the software module initiates a phase in which the software module applies for locking the memory, and the memory locking process in this phase comprises:
taking half of the total amount of the current unlocked memory as the upper limit of the current instance locked memory amount of the software module, comparing the upper limit of the current instance locked memory amount with the user expected value of the software module, and taking the smaller value of the upper limit and the user expected value as the actual instance locked memory amount of the software module, namely the locked memory initially applied by the software module.
3. The method of claim 1, wherein if the memory expansion of the current software module is not successful after a round of unlocking the unused memory of all existing software modules is completed, declaring that the memory expansion application of the current software module fails.
4. A dynamic control system for total memory amount based on block memory is used for allocating memory to each software module batch by batch respectively, and comprises:
the initial application unit is configured to apply for locking the memory by the software module in the initialization stage of the software module, and the locking memory is determined by the user expected value and the actual memory of the system;
the extended application unit is configured to apply for relocking an extended memory by the software module after the locked memory corresponding to the software module is used up, compare the extended memory with the remaining lockable memory, and then determine whether to call the unused memory of other existing software modules until the software module successfully expands the memory, otherwise, quit, and declare that the application of relocking fails;
In the extension application unit, after the locking memory corresponding to the software module is used up, the software module applies for re-locking an extension memory, and re-locking the extension memory, the extension application unit includes:
the primary expansion unit is configured to calculate the current unlocked memory amount, compare the calculated current unlocked memory amount with the minimum expansion unit memory amount of the current software module, and if the current unlocked memory amount is not smaller than the minimum expansion unit memory amount, relock the memory according to the current unlocked memory amount and declare that the memory expansion of the current software module is successful; otherwise, unlocking and calling the unused memory of other existing software modules;
the extension application unit further comprises a secondary extension unit, the secondary extension unit is configured to unlock and call the existing memory which is not used by other software modules, and the processing process comprises the following steps:
other existing software modules are subjected to increasing sequencing according to the memory utilization rate, and half of the unused memory amount of each software module is unlocked in sequence from the software module with the lowest memory utilization rate;
and if the current unlocked memory amount is not less than the minimum expansion unit memory amount, the memory is locked again according to the current unlocked memory amount, the memory expansion success of the current software module is declared, otherwise, the calculation of the current unlocked memory amount and the comparison of the current unlocked memory amount and the minimum expansion unit memory amount of the current software module are carried out again after the unused memory of the next existing software module is unlocked continuously until the memory expansion of the current software module succeeds or one round of unlocking of the unused memories of all the existing software modules is completed.
5. The system of claim 4, wherein in the initial application unit, the software module applies for locking the memory during an initialization phase of the software module, and a memory locking process at this phase comprises:
taking half of the total amount of the current unlocked memory as the upper limit of the current instance locked memory amount of the software module, comparing the upper limit of the current instance locked memory amount with the user expected value of the software module, and taking the smaller value of the upper limit and the user expected value as the actual instance locked memory amount of the software module, namely the locked memory initially applied by the software module.
6. The system of claim 4, wherein if the memory expansion of the current software module is not successful after a round of unlocking the unused memory of all the existing software modules is completed, the system declares that the memory expansion application of the current software module fails.
CN201910872169.9A 2019-09-16 2019-09-16 Method and system for dynamically controlling total memory amount based on block memory Active CN110647397B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910872169.9A CN110647397B (en) 2019-09-16 2019-09-16 Method and system for dynamically controlling total memory amount based on block memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910872169.9A CN110647397B (en) 2019-09-16 2019-09-16 Method and system for dynamically controlling total memory amount based on block memory

Publications (2)

Publication Number Publication Date
CN110647397A CN110647397A (en) 2020-01-03
CN110647397B true CN110647397B (en) 2022-06-03

Family

ID=68991901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910872169.9A Active CN110647397B (en) 2019-09-16 2019-09-16 Method and system for dynamically controlling total memory amount based on block memory

Country Status (1)

Country Link
CN (1) CN110647397B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508717A (en) * 2011-11-17 2012-06-20 大唐移动通信设备有限公司 Memory scheduling method and memory scheduling device for multi-core processor
CN103116548A (en) * 2012-12-07 2013-05-22 大连奥林匹克电子城咨信商行 Memory management system
CN106933670A (en) * 2015-12-29 2017-07-07 航天信息股份有限公司 A kind of method of dynamically managing application program internal memory
CN107153618A (en) * 2016-03-02 2017-09-12 阿里巴巴集团控股有限公司 A kind of processing method and processing device of Memory Allocation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103365720B (en) * 2012-03-28 2017-12-05 国际商业机器公司 For dynamically adjusting the method and system of global Heap Allocation under multi-thread environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508717A (en) * 2011-11-17 2012-06-20 大唐移动通信设备有限公司 Memory scheduling method and memory scheduling device for multi-core processor
CN103116548A (en) * 2012-12-07 2013-05-22 大连奥林匹克电子城咨信商行 Memory management system
CN106933670A (en) * 2015-12-29 2017-07-07 航天信息股份有限公司 A kind of method of dynamically managing application program internal memory
CN107153618A (en) * 2016-03-02 2017-09-12 阿里巴巴集团控股有限公司 A kind of processing method and processing device of Memory Allocation

Also Published As

Publication number Publication date
CN110647397A (en) 2020-01-03

Similar Documents

Publication Publication Date Title
US10083199B1 (en) Data migration in active data store
CN106802939B (en) Method and system for solving data conflict
CN109587220B (en) Load balancing method and device, computer equipment and storage medium
CN114327946A (en) Shared memory access control method and device, electronic equipment and automatic driving vehicle
CN116185623A (en) Task allocation method and device, electronic equipment and storage medium
CN106649654A (en) Data updating method and device
CN110750517B (en) Data processing method, device and equipment of local storage engine system
CN112148480A (en) Task processing method, device and equipment based on multithreading and storage medium
CN110647397B (en) Method and system for dynamically controlling total memory amount based on block memory
US20160139959A1 (en) Information processing system, method and medium
CN106919450B (en) Resource adjusting method and device
CN109711193B (en) Storage space sharing method and device
JP2016157399A (en) Information processor, information processing system and exclusion control program
CN111694835B (en) Number section access method, system, equipment and storage medium of logistics electronic bill
CN109543394B (en) Function triggering method, system, device and computer readable storage medium
CN110764876A (en) Cloud host creation method, device, equipment and readable storage medium
CN115328621B (en) Transaction processing method, device, equipment and storage medium based on block chain
CN108647090B (en) Resource allocation method and device and server cluster
CN114756527A (en) Method and device for expanding Redis cluster, electronic equipment and storage medium
CN106815061B (en) Service processing method and device
CN115114612A (en) Access processing method, device, electronic equipment and storage medium
CN106650480B (en) File access isolation method and device
CN113419672B (en) Storage capacity management method, system and storage medium
US11748002B2 (en) Highly concurrent data store allocation
CN115878158A (en) Method, device and equipment for automatically upgrading data based on examples

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant