CN108804233A - Memory headroom recovery method, device, electronic equipment and storage medium - Google Patents

Memory headroom recovery method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN108804233A
CN108804233A CN201810679789.6A CN201810679789A CN108804233A CN 108804233 A CN108804233 A CN 108804233A CN 201810679789 A CN201810679789 A CN 201810679789A CN 108804233 A CN108804233 A CN 108804233A
Authority
CN
China
Prior art keywords
variable
instruction
instruction group
memory headroom
instruction set
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
CN201810679789.6A
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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201810679789.6A priority Critical patent/CN108804233A/en
Publication of CN108804233A publication Critical patent/CN108804233A/en
Pending legal-status Critical Current

Links

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/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/5022Mechanisms to release resources

Abstract

The embodiment of the invention discloses memory headroom recovery method, device, electronic equipment and storage mediums, obtain the corresponding first position of the first variable that pending instruction group includes, wherein, the first position is characterized in the position that first variable is finally used when executing described instruction group;It is inserted into the flush instructions for emptying the memory headroom that first variable occupies behind the first position, obtains updated instruction group;Execute updated instruction group.First variable is any variable in pending instruction group, optionally, in each variable finally using position inserted with corresponding flush instructions in updated instruction group.So that after instruction group use finishes the first variable, the memory headroom of the first variable occupancy will be emptied, that is, does not interfere with the execution of instruction group, the first variable in memory headroom can be also emptied in time, from the situation without memory headroom deficiency.

Description

Memory headroom recovery method, device, electronic equipment and storage medium
Technical field
The present invention relates to field of computer technology, and more specifically, it relates to memory headroom recovery method, device, electronics Equipment and storage medium.
Background technology
Computer instruction is exactly the instruction and order for commanding machine operation, and program code is arranged in certain sequence comprising a series of The instruction of row, the process for executing program code is exactly the course of work of computer.Program code is related to multiple variables, program code In the process of implementation, variable can committed memory space always.
If the time that program code (for example, the program code write using java language) is executed is longer, program code Including variable can committed memory space always, cause memory headroom insufficient.
Invention content
In view of this, the present invention provides a kind of memory headroom recovery method, device, electronic equipment and storage mediums.
To achieve the above object, the present invention provides the following technical solutions:
A kind of memory headroom recovery method, including:
Obtain the corresponding first position of the first variable that pending instruction group includes, wherein the first position characterization The position of first variable is finally used when executing described instruction group;
It is inserted into the flush instructions for emptying the memory headroom that first variable occupies behind the first position, is updated Instruction group afterwards;
Execute updated instruction group.
Wherein, described instruction group includes at least one instruction set, and an instruction set includes one or more instructions, described to obtain The corresponding first position of the first variable that pending instruction group includes is taken to include:
Obtain the corresponding life parameter of described instruction group, wherein the life parameter includes described at least one The corresponding initial order position of a instruction set and command for stopping position;
The corresponding second position of first variable is obtained, the second position, which is characterized in described instruction group, finally to be occurred Position;
Based on the life parameter and the corresponding second position of first variable, first variable pair is obtained The first position answered.
Wherein, described to be based on the life parameter and the corresponding second position of first variable, described in acquisition The corresponding first position of first variable includes:
Based on the life parameter, the first instruction set belonging to the corresponding second position of first variable is determined;
Based on the instruction type of first instruction set, the corresponding first position of first variable is determined.
Wherein, the instruction type based on first instruction set determines the corresponding first position of first variable Including:
If the instruction type of first instruction set is the first kind, the second position is determined as described first It sets, it is 1 that the first kind, which characterizes the number that first variable is called in first instruction set,;
If the instruction type of first instruction set is Second Type, by the corresponding command for stopping position of first instruction set It sets and is determined as the first position, the Second Type characterizes the number that first variable is called in first instruction set More than 1.
Wherein, further include:
It is instructed based on pending source program, obtains described instruction group.
Wherein, it is described be inserted into the memory headroom for emptying that first variable occupies behind the first position empty finger It enables, obtaining updated instruction group includes:
Between the first instruction set and the second instruction set, it is inserted into emptying for the memory headroom for emptying that first variable occupies Instruction;
Wherein, first instruction set be the corresponding second position of first variable belonging to instruction set, described second Instruction set is the next instruction collection of first instruction set, and the second position characterizes first variable in described instruction group The position finally occurred.
A kind of memory headroom retracting device, including:
Acquisition module, the corresponding first position of the first variable for including for obtaining pending instruction group, wherein described First position is characterized in the position that first variable is finally used when executing described instruction group;
It is inserted into module, emptying for memory headroom that first variable occupies is emptied for being inserted into behind the first position Instruction, obtains updated instruction group;
Execution module, for executing updated instruction group.
Wherein, described instruction group includes at least one instruction set, and an instruction set includes one or more instructions, described to obtain Modulus block includes:
First acquisition unit, for obtaining the corresponding life parameter of described instruction group, wherein the life cycle ginseng Number includes the corresponding initial order position of at least one instruction set and command for stopping position;
Second acquisition unit, for obtaining the corresponding second position of first variable, the second position is characterized in institute State the position finally occurred in instruction group;
Third acquiring unit, for being based on the life parameter and the corresponding second position of first variable, Obtain the corresponding first position of first variable.
A kind of electronic equipment, including:
Memory, for storing program;
Processor, for executing described program, described program is specifically used for:
Obtain the corresponding first position of the first variable that pending instruction group includes, wherein the first position characterization The position of first variable is finally used when executing described instruction group;
It is inserted into the flush instructions for emptying the memory headroom that first variable occupies behind the first position, is updated Instruction group afterwards;
Execute updated instruction group.
A kind of readable storage medium storing program for executing, is stored thereon with computer program, which is characterized in that the computer program is handled When device executes, each step that the memory headroom recovery method as described in any of the above-described includes is realized.
It can be seen via above technical scheme that compared with prior art, the invention discloses a kind of memory headroom recycling sides Method obtains the corresponding first position of the first variable that pending instruction group includes, wherein the first position is characterized in execution The position of first variable is finally used when described instruction group;Insertion empties first variable and accounts for behind the first position The flush instructions of memory headroom obtain updated instruction group;Execute updated instruction group.First variable is pending Instruction group in any variable, optionally, in updated instruction group each variable finally using position inserted with phase The flush instructions answered.So that after instruction group use finishes the first variable, the memory headroom of the first variable occupancy will be emptied, i.e., not The execution of instruction group can be influenced, can also empty the first variable in memory headroom in time, from without memory headroom deficiency The case where.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow chart of realization method of memory headroom recovery method provided in an embodiment of the present invention;
Fig. 2 is the first variable corresponding first position provided in an embodiment of the present invention for obtaining pending instruction group and including A kind of realization method flow chart;
Fig. 3 is the structure chart of the realization method of memory headroom retracting device provided in an embodiment of the present invention;
Fig. 4 is a kind of structure chart of realization method of electronic equipment provided in an embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
In the process of implementation, variable in program code can committed memory space always for current procedure code.For example, utilizing The program code for the big data project that java language is write includes multiple multivariables, when running the program code, program code In include many variables, a large amount of memory headrooms can be occupied.
It names a hello world examples to illustrate, it is assumed that program code is as follows:
Above procedure code in the process of implementation, variable s when program code goes to position 2, program code it is follow-up Program will not use arrive variable s in the process of implementation, but the still committed memory spaces variable s.
To sum up, Partial Variable is when program code goes to certain phase in program code, the down-stream of program code It will not use in the process of implementation and arrive these variables, but these variables still committed memory space, this is certain to memory sky Between require very stringent scene, for example, scenes of the java as backstage resident service, memory headroom will be caused insufficient.
To solve the above-mentioned problems, an embodiment of the present invention provides a kind of memory headroom recovery methods, as shown in Figure 1, being A kind of flow chart of realization method of memory headroom recovery method provided in an embodiment of the present invention, this method include:
Step S101:Obtain the corresponding first position of the first variable that pending instruction group includes, wherein described first Position is characterized in the position that first variable is finally used when executing described instruction group.
First variable is any variable in pending instruction group.
Instruction group in the embodiment of the present invention may include one or more instruction.
In an alternative embodiment, instruction group may include bytecode;Bytecode (Byte-code) is a kind of comprising execution Program is a kind of intermediate code by a sequence op code/datas to the binary file formed.If instruction group includes bytecode, It can instruct to obtain the instruction group based on pending source program.
For example, if program code, which is Java source programs, instructs (.java files), Java source programs are instructed by Java It can be converted into Java bytecode file (.class files) after compiler compiling.The content that byte code files include is byte Code.
Byte code files are more special, internal not include any separator differentiation paragraph.The word of one group of octet unit Throttling constitutes a complete byte code files.
Still by taking above-mentioned hello world program codes as an example, corresponding bytecode is as follows:
0:ldc#2//String hello
2:Astore_1//astore is instructed, for informing that variable is assigned, so as to tracking variable
3:aconst_null
4:astore_2
5:Aload_2//aload is instructed, and is used for record variable position
6:if null 21
9:getstatic#3//Field java/lang/System.out:Ljava/io/PrintStream;
12:aload_1
13:invokevirtual#4//Methodjava/io/PrintStream.println:(Ljava/lang/ String;)V
16:iconst_1
17:invokestatic#5//Methodjava/lang/Integer.valueOf:(I)Ljava/lang/ Integer;
20:astore_2
21:getstatic#3//Field java/lang/System.out:Ljava/io/PrintStream;
24:ldc#6//String world
26:invokevirtual#4//Method java/io/PrintStream.println:(Ljava/lang/ String;)V
29:return
In an alternative embodiment, instruction group may include program code.
Still by taking above-mentioned hello world program codes as an example, if instruction group includes program code, the last of variable s makes It is position 2 with position;If instruction group includes bytecode, variable s's is finally 16 using position:The positions iconst_1 # 16。
Step S102:That the memory headroom for emptying that first variable occupies is inserted into behind the first position empties finger It enables, obtains updated instruction group.
Step S101 is executed to any variable in pending instruction group and obtains updated instruction to step S102 Group.
Step S103:Execute updated instruction group.
Memory headroom recovery method provided in an embodiment of the present invention obtains the first variable pair that pending instruction group includes The first position answered, wherein the first position is characterized in the position that first variable is finally used when executing described instruction group It sets;It is inserted into the flush instructions for emptying the memory headroom that first variable occupies behind the first position, obtains updated Instruction group;Execute updated instruction group.First variable is any variable in pending instruction group, optionally, updated In each variable finally using position inserted with corresponding flush instructions in instruction group.So that instruction group use finishes first After variable, the memory headroom of the first variable occupancy will be emptied, that is, does not interfere with the execution of instruction group, can also empty memory in time The first variable in space, from the situation without memory headroom deficiency.
As shown in Fig. 2, corresponding for the first variable that the pending instruction group of acquisition provided in an embodiment of the present invention includes A kind of flow chart of realization method of first position, this method include:
Step S201:Obtain the corresponding life parameter of described instruction group, wherein the life parameter includes institute State the corresponding initial order position of at least one instruction set and command for stopping position.
Described instruction group includes at least one instruction set, and an instruction set includes one or more instructs.
In an alternative embodiment, at least one instruction set may include:At least one recursion instruction collection, and/or, At least one selection instruction collection, and/or, at least one assignment directive collection etc..Wherein, recursion instruction collection, selection instruction collection, assignment Instruction set is merely illustrative, because can not exhaustive all instructions collection.
Recursion instruction, which integrates, to be where instruction set or while instruction set or for instruction set etc., and selection instruction collection can Think if instruction set etc..
By taking above-mentioned hello world program codes as an example, above-mentioned hello world program codes include if instruction set.If Instruction group includes program code, then if instruction set includes:(i!=null) { System.out.println (s);I=1;, if Instruction group includes bytecode, then if instruction set includes:From 6:If null 21 to 21:getstatic#3//Field java/ lang/System.out:Ljava/io/PrintStream, i.e. if instruction set include from the slot # 6 of bytecode to slot # 21 Instruction.The initial order position of the if instruction set is #6, and command for stopping position is #21.If instruction group includes program code, The program code includes two assignment directive collection, respectively String s=" hello " assignment directive collection and Integer i =null assignment directive collection.
To sum up, an instruction set includes continuous at least one instruction in instruction group, and continuous at least one finger Enable a type of directive statement of general token.
In an alternative embodiment, the Object Life Cycle figure of pending instruction group can be obtained, for example, java objects Life cycle figure, can be with the corresponding life parameter of acquisition instruction group based on Object Life Cycle figure.
Step S202:The corresponding second position of first variable is obtained, the second position is characterized in described instruction group In the position that finally occurs.
It can be seen that variable s's is not finally that variable s finally occurs using position from above-mentioned hello world program codes Position 1 may relate to recycle because position 1 is located in if sentences, there is the case where Reusability variable s, therefore, if languages After sentence, i.e., variable s is only at position 2 finally uses position.
In an alternative embodiment, instruction group can be traversed, is finally occurred in instruction group to obtaining the first variable Position.If astore is instructed in the corresponding bytecode of above-mentioned hello world program codes, for informing that variable is assigned, with Just tracking variable;Aload is instructed, and is used for record variable position;It can be obtained by based on astore instructions and aload instructions each The position that variable finally occurs in instruction group.
Step S203:Based on the life parameter and the corresponding second position of first variable, described in acquisition The corresponding first position of first variable.
In an alternative embodiment, step S203 may include:
Based on the life parameter, the first instruction set belonging to the corresponding second position of first variable is determined; Based on the instruction type of first instruction set, the corresponding first position of first variable is determined.
In an alternative embodiment, if the instruction type of first instruction set is the first kind, by the second position It is determined as the first position, the first kind characterizes the number that first variable is called in first instruction set and is 1。
In an alternative embodiment, the first kind may include:Assignment directive collection.
In an alternative embodiment, if the instruction type of first instruction set is Second Type, described first is instructed It is the first position to collect corresponding command for stopping location determination, and the Second Type characterizes first variable in first finger It enables and called number is concentrated to be more than 1.
In an alternative embodiment, Second Type may include recursion instruction collection or selection instruction collection.
In an alternative embodiment, the memory headroom for emptying that first variable occupies is inserted into behind the first position Flush instructions, obtaining updated instruction group includes:
Between the first instruction set and the second instruction set, it is inserted into emptying for the memory headroom for emptying that first variable occupies Instruction.
Wherein, first instruction set be the corresponding second position of first variable belonging to instruction set, described second Instruction set is the next instruction collection of first instruction set, and the second position characterizes first variable in described instruction group The position finally occurred.
Still by taking above-mentioned hello world program codes as an example, the first instruction set refers to if instruction set, and the second instruction set is System.out.println (" world ") instruction set.
Method is described in detail in aforementioned present invention disclosed embodiment, diversified forms can be used for the method for the present invention Device realize that therefore the invention also discloses a kind of devices, and specific embodiment is given below and is described in detail.
As shown in figure 3, the structure chart of the realization method for memory headroom retracting device provided in an embodiment of the present invention, this is interior Depositing space reclamation device includes:
Acquisition module 31, the corresponding first position of the first variable for including for obtaining pending instruction group, wherein institute It states first position and is characterized in the position for finally using first variable when executing described instruction group;
It is inserted into module 32, the clear of memory headroom that first variable occupies is emptied for being inserted into behind the first position Do-nothing instruction obtains updated instruction group;
Execution module 33, for executing updated instruction group.
Optionally, described instruction group includes at least one instruction set, and an instruction set includes one or more instructions, described Acquisition module includes:
First acquisition unit, for obtaining the corresponding life parameter of described instruction group, wherein the life cycle ginseng Number includes the corresponding initial order position of at least one instruction set and command for stopping position;
Second acquisition unit, for obtaining the corresponding second position of first variable, the second position is characterized in institute State the position finally occurred in instruction group;
Third acquiring unit, for being based on the life parameter and the corresponding second position of first variable, Obtain the corresponding first position of first variable.
Optionally, third acquiring unit includes:
First determination subelement determines the corresponding second of first variable for being based on the life parameter Set the first affiliated instruction set;
Second determination subelement is used for the instruction type based on first instruction set, determines that first variable corresponds to First position.
Optionally, the second determination subelement includes:
First determination sub-module, if the instruction type for first instruction set is the first kind, by the second It sets and is determined as the first position, the first kind characterizes the number that first variable is called in first instruction set It is 1;
Second determination sub-module refers to if the instruction type for first instruction set is Second Type by described first Enable that collect corresponding command for stopping location determination be the first position, the Second Type characterize first variable this first The number being called in instruction set is more than 1.
Optionally, further include:
Second acquisition module obtains described instruction group for being instructed based on pending source program.
Optionally, being inserted into module includes:
It is inserted into unit, empties what first variable occupied between the first instruction set and the second instruction set, being inserted into The flush instructions of memory headroom;
Wherein, first instruction set be the corresponding second position of first variable belonging to instruction set, described second Instruction set is the next instruction collection of first instruction set, and the second position characterizes first variable in described instruction group The position finally occurred.
As shown in figure 4, a kind of structure chart of realization method for electronic equipment provided in an embodiment of the present invention, the electronics are set It is standby to include:
Memory 41, for storing program;
Processor 42, for executing described program, described program is specifically used for:
Obtain the corresponding first position of the first variable that pending instruction group includes, wherein the first position characterization The position of first variable is finally used when executing described instruction group;
It is inserted into the flush instructions for emptying the memory headroom that first variable occupies behind the first position, is updated Instruction group afterwards;
Execute updated instruction group.
Memory 41 may include high-speed RAM memory, it is also possible to further include nonvolatile memory (non-volatile Memory), a for example, at least magnetic disk storage.
Processor 42 may be a central processor CPU or specific integrated circuit ASIC (Application Specific Integrated Circuit), or be arranged to implement the integrated electricity of one or more of the embodiment of the present invention Road.
Optionally, electronic equipment can also include communication bus 43 and communication interface 44, wherein memory 41, processing Device 42, completes mutual communication by communication bus 43 at communication interface 44;
Optionally, communication interface 44 can be the interface of communication module, such as the interface of gsm module.
The embodiment of the present invention additionally provides a kind of readable storage medium storing program for executing, is stored thereon with computer program, which is characterized in that When the computer program is executed by processor, each step that the memory headroom recovery method as described in any of the above-described includes is realized Suddenly.
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment weight Point explanation is all difference from other examples, and the same or similar parts between the embodiments can be referred to each other. For device or system class embodiment, since it is basically similar to the method embodiment, so description is fairly simple, it is related Place illustrates referring to the part of embodiment of the method.
It should also be noted that, herein, relational terms such as first and second and the like are used merely to one Entity or operation are distinguished with another entity or operation, without necessarily requiring or implying between these entities or operation There are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to contain Lid non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest range caused.

Claims (10)

1. a kind of memory headroom recovery method, which is characterized in that including:
Obtain the corresponding first position of the first variable that pending instruction group includes, wherein the first position, which is characterized in, holds The position of first variable is finally used when row described instruction group;
It is inserted into the flush instructions for emptying the memory headroom that first variable occupies behind the first position, obtains updated Instruction group;
Execute updated instruction group.
2. memory headroom recovery method according to claim 1, which is characterized in that described instruction group includes at least one instruction Collection, instruction set include it is one or more instruct, it is described to obtain the first variable that pending instruction group includes corresponding the One position includes:
Obtain the corresponding life parameter of described instruction group, wherein the life parameter includes at least one finger It enables and collects corresponding initial order position and command for stopping position;
The corresponding second position of first variable is obtained, the second position is characterized in the position finally occurred in described instruction group It sets;
Based on the life parameter and the corresponding second position of first variable, it is corresponding to obtain first variable First position.
3. memory headroom recovery method according to claim 2, which is characterized in that it is described based on the life parameter with And the corresponding second position of first variable, obtaining the corresponding first position of first variable includes:
Based on the life parameter, the first instruction set belonging to the corresponding second position of first variable is determined;
Based on the instruction type of first instruction set, the corresponding first position of first variable is determined.
4. memory headroom recovery method according to claim 3, which is characterized in that the finger based on first instruction set Type is enabled, determines that the corresponding first position of first variable includes:
If the instruction type of first instruction set is the first kind, the second position is determined as the first position, institute It is 1 to state the first kind and characterize the number that first variable is called in first instruction set;
If the instruction type of first instruction set is Second Type, and the corresponding command for stopping position of first instruction set is true It is set to the first position, the Second Type characterizes the number that first variable is called in first instruction set and is more than 1。
5. according to any memory headroom recovery method of Claims 1-4, which is characterized in that further include:
It is instructed based on pending source program, obtains described instruction group.
6. memory headroom recovery method according to claim 2, which is characterized in that described to be inserted into clearly behind the first position The flush instructions for the memory headroom that empty first variable occupies, obtaining updated instruction group includes:
Between the first instruction set and the second instruction set, that is inserted into the memory headroom for emptying that first variable occupies empties finger It enables;
Wherein, first instruction set is the instruction set belonging to the corresponding second position of first variable, second instruction Collection is the next instruction collection of first instruction set, and it is last in described instruction group that the second position characterizes first variable The position of appearance.
7. a kind of memory headroom retracting device, which is characterized in that including:
Acquisition module, the corresponding first position of the first variable for including for obtaining pending instruction group, wherein described first Position is characterized in the position that first variable is finally used when executing described instruction group;
Be inserted into module, for be inserted into behind the first position empty memory headroom that first variable occupies empty finger It enables, obtains updated instruction group;
Execution module, for executing updated instruction group.
8. memory headroom retracting device according to claim 7, which is characterized in that described instruction group includes at least one instruction Collection, an instruction set include one or more instructions, and the acquisition module includes:
First acquisition unit, for obtaining the corresponding life parameter of described instruction group, wherein the life parameter packet Include the corresponding initial order position of at least one instruction set and command for stopping position;
Second acquisition unit, for obtaining the corresponding second position of first variable, the second position is characterized in the finger Enable the position finally occurred in group;
Third acquiring unit is obtained for being based on the life parameter and the corresponding second position of first variable The corresponding first position of first variable.
9. a kind of electronic equipment, which is characterized in that including:
Memory, for storing program;
Processor, for executing described program, described program is specifically used for:
Obtain the corresponding first position of the first variable that pending instruction group includes, wherein the first position, which is characterized in, holds The position of first variable is finally used when row described instruction group;
It is inserted into the flush instructions for emptying the memory headroom that first variable occupies behind the first position, obtains updated Instruction group;
Execute updated instruction group.
10. a kind of readable storage medium storing program for executing, is stored thereon with computer program, which is characterized in that the computer program is handled When device executes, each step that the memory headroom recovery method as described in claim 1 to 6 is any includes is realized.
CN201810679789.6A 2018-06-27 2018-06-27 Memory headroom recovery method, device, electronic equipment and storage medium Pending CN108804233A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810679789.6A CN108804233A (en) 2018-06-27 2018-06-27 Memory headroom recovery method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810679789.6A CN108804233A (en) 2018-06-27 2018-06-27 Memory headroom recovery method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN108804233A true CN108804233A (en) 2018-11-13

Family

ID=64072036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810679789.6A Pending CN108804233A (en) 2018-06-27 2018-06-27 Memory headroom recovery method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108804233A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000132406A (en) * 1998-10-21 2000-05-12 Hitachi Ltd Optimization method for object memory
US6647547B1 (en) * 1999-05-18 2003-11-11 Matsushita Electric Industrial Co., Ltd. Program conversion apparatus for eliminating unnecessary indications of dynamic memory allocation from a source program and generating an executable program
US20070150868A1 (en) * 2005-12-28 2007-06-28 Gansha Wu Inserting stack clearing code in conservative garbage collection
CN101493767A (en) * 2009-01-20 2009-07-29 中国科学技术大学 Pile pitching method of explicit releasing object in instant compiler-aid refuse collection
CN104750563A (en) * 2013-12-26 2015-07-01 北京大学 A memory leak auto repair method based on control flow diagram

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000132406A (en) * 1998-10-21 2000-05-12 Hitachi Ltd Optimization method for object memory
US6647547B1 (en) * 1999-05-18 2003-11-11 Matsushita Electric Industrial Co., Ltd. Program conversion apparatus for eliminating unnecessary indications of dynamic memory allocation from a source program and generating an executable program
US20070150868A1 (en) * 2005-12-28 2007-06-28 Gansha Wu Inserting stack clearing code in conservative garbage collection
CN101493767A (en) * 2009-01-20 2009-07-29 中国科学技术大学 Pile pitching method of explicit releasing object in instant compiler-aid refuse collection
CN104750563A (en) * 2013-12-26 2015-07-01 北京大学 A memory leak auto repair method based on control flow diagram

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吴伶 等: "《C语言程序设计》", 28 February 2015 *
彭文: ""一种针对Java中字符串的内存管理方案"", 《微型机与应用》 *

Similar Documents

Publication Publication Date Title
CN102722432B (en) Follow the trail of the method and apparatus of internal storage access
CN1222875C (en) Object-oriented instruction set for resource-constrained devices
CN103019787B (en) Function calling relationship determines method, hot patch upgrade method and device
US6493730B1 (en) Efficient object faulting with generational garbage collection
KR19990007400A (en) A bounded downtime closed area recovery system and method comprising a write barrier associated with a source instance of some relocated object
WO2006052321A2 (en) System and method of reading non-volatile computer memory
CN105159777A (en) Process memory collection method and apparatus
US20040162861A1 (en) Parallel non-contiguous allocation and card parsing
US6427154B1 (en) Method of delaying space allocation for parallel copying garbage collection
WO2015026966A1 (en) System and method for dynamically selecting a garbage collection algorithm based on the contents of heap regions
CN108984328A (en) A kind of method and device of Stack back trace
US6999979B2 (en) Efficient encoding of references into a collection set
CN100517269C (en) Processor architecture for exact index identification
CN106406972A (en) Program compiling method and compiler
US10318585B2 (en) Facilitating efficient garbage collection by dynamically coarsening an append-only lock-free trie
CN102591788B (en) Method for recovering Java card garbage
US8176286B2 (en) Memory recycling in computer systems
US7660961B2 (en) Concurrent evacuation of the young generation
CN100489781C (en) Method and apparatus for positioning target file
CN1695206A (en) Method of and apparatus for detecting an error in writing to persistent memory
CN108804233A (en) Memory headroom recovery method, device, electronic equipment and storage medium
US20120221821A1 (en) Method of managing memory in computer system, computer system and memory managing program
CN106354624B (en) Automatic testing method and device
CN110399166A (en) Store method, device, equipment and the storage medium of ME Nonce value
CN113760193B (en) Data read-write method and device for resource-restricted device and instruction set

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20181113

RJ01 Rejection of invention patent application after publication