CN110083525A - Localization method, device, computer equipment and the storage medium of RAM leakage - Google Patents
Localization method, device, computer equipment and the storage medium of RAM leakage Download PDFInfo
- Publication number
- CN110083525A CN110083525A CN201910199036.XA CN201910199036A CN110083525A CN 110083525 A CN110083525 A CN 110083525A CN 201910199036 A CN201910199036 A CN 201910199036A CN 110083525 A CN110083525 A CN 110083525A
- Authority
- CN
- China
- Prior art keywords
- information
- memory
- creation
- ram leakage
- target object
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 230000004807 localization Effects 0.000 title claims abstract description 23
- 238000003860 storage Methods 0.000 title claims abstract description 15
- 238000012545 processing Methods 0.000 claims description 20
- 238000007599 discharging Methods 0.000 claims description 7
- 238000013507 mapping Methods 0.000 claims description 6
- 230000000007 visual effect Effects 0.000 abstract description 6
- 238000012550 audit Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 16
- 238000007630 basic procedure Methods 0.000 description 10
- 230000006854 communication Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 9
- 241000406668 Loxodonta cyclotis Species 0.000 description 3
- 238000000151 deposition Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012163 sequencing technique Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007175 bidirectional communication Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000008034 disappearance Effects 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000008140 language development Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/32—Monitoring with visual or acoustical indication of the functioning of the machine
- G06F11/324—Display of status information
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/362—Software debugging
- G06F11/366—Software debugging using diagnostics
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Storage Device Security (AREA)
Abstract
The embodiment of the invention discloses a kind of localization method of RAM leakage, device, computer equipment and storage medium, include the following steps: the memory information for obtaining monitored object, wherein the memory information includes the creation information of the memory of multiple objects;Judge whether the creation information of the multiple object all has corresponding release information;When there are the target object of no corresponding release information, determine that the target object is the object of RAM leakage.By the memory information for obtaining target object, and the creation judged whether there is in memory information with target memory records corresponding RR release record, when it be not present, it can confirm that the target object memory is not released, for RAM leakage object, this method, which only needs to record the creation record of memory and RR release record, to inquire, and method is simple, by memory information carry out visual setting can also intuitive audit memory occupancy situation.
Description
Technical field
The present embodiments relate to computer field, especially a kind of localization method of RAM leakage, device, computer are set
Standby and storage medium.
Background technique
In computer science, RAM leakage refers to not to have been used since carelessness or mistake cause program to fail release
Memory the case where.It does not mean that disappearance physically, but after application assigned section memory, due to being related to mistake,
Lose the control to this section of memory, caused by memory waste situation.Under normal circumstances, RAM leakage can only be by program source generation
The programmer of code just can analyze out.
Usually it will use special tool, such as boundschecker, Visualleak when detecting RAM leakage
The tools such as Detector carry out special code detection.But above-mentioned tool need it is separately installed, when becoming language development tool
This can be automatically inserted when starting to become in the toolbar of software.The disadvantages of the method are as follows the resource occupied is more, and detected
Journey is cumbersome, complicated, and cannot intuitively check memory occupation information.
Summary of the invention
The embodiment of the present invention provides localization method, device, computer equipment and the storage medium of a kind of RAM leakage.
In order to solve the above technical problems, the technical solution that the embodiment of the invention uses is: providing in one kind
The localization method for depositing leakage, includes the following steps:
Obtain the memory information of monitored object, wherein the memory information includes the creation of the memory of multiple objects
Information;
Judge whether the creation information of the multiple object all has corresponding release information;
When there are the target object of no corresponding release information, determine that the target object is pair of RAM leakage
As.
Optionally, before the memory information for obtaining monitored object, further includes:
The object is monitored;
Obtain the memory creation instruction of the object;
The creation information of the object is recorded in preset memory information list according to memory creation instruction.
Optionally, the memory information is that record has the creation information of multiple objects and the memory information column of release information
Table;Whether the creation information for judging the multiple object all has corresponding release information, comprising:
The identification code of object is extracted from the memory information list;
Judge that there are mapping relations with the presence or absence of with the identification code in the memory information list according to the identification code
Release information.
Optionally, the object includes: the first object and the second object, wherein the second object is nested with the first object;It is interior
Depositing the creation information of the first object and the second object in information is in tree-shaped arrangement;The creation information of the multiple object of judgement
Whether all there is corresponding release information, comprising:
Obtain the information of first object;
It is obtained from the memory information according to the information of first object nested with first object all
The information of second object;
Judge in second object with the presence or absence of the object without discharging information.
Optionally, the determination target object is the object of RAM leakage, comprising:
Obtain the identification code of the target object;
Judge whether the target object is singleton object;
When the target object is not singleton object, determine the target object be RAM leakage, object.
It is optionally, described to judge whether the target object is singleton object, comprising:
The object information of the target object is searched in the memory information according to the identification code;
Judge whether there is singleton label in the object information.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of positioning device of RAM leakage, comprising:
Module is obtained, for obtaining the memory information of monitored object, wherein the memory information includes multiple objects
Memory creation information;
Processing module, for judging whether the creation information of the multiple object all has corresponding release information;
Execution module, for determining that the target object is when there are the target object of no corresponding release information
The object of RAM leakage.
Optionally, further includes:
First processing submodule, for being monitored to the object;
First acquisition submodule, the memory for obtaining the object create instruction;
The creation information of the object is recorded in preset memory information list according to memory creation instruction.
Optionally, the memory information is that record has the creation information of multiple objects and the memory information column of release information
Table;The processing module includes:
Second acquisition submodule, for extracting the identification code of object from the memory information list;
Second processing submodule, for according to the identification code judge in the memory information list whether there is with it is described
Identification code has the release information of mapping relations.
Optionally, the object includes: the first object and the second object, wherein the second object is nested with the first object;It is interior
Depositing the creation information of the first object and the second object in information is in tree-shaped arrangement;The processing module includes:
Third acquisition submodule, for obtaining the information of first object;
Third handles submodule, for being obtained from the memory information according to the information of first object and described the
The information of the second all objects of an object nesting;
Fourth process submodule, for judging in second object with the presence or absence of the object without discharging information.
Optionally, the execution module includes:
Third acquisition submodule, for obtaining the identification code of the target object;
Fourth process submodule, for judging whether the target object is singleton object;
First implementation sub-module, for determining that the target object is interior when the target object is not singleton object
Deposit the object of leakage.
Optionally, the fourth process submodule includes:
5th processing submodule, for searching pair of the target object in the memory information according to the identification code
Image information;
6th processing submodule, for judging whether there is singleton label in the object information.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of computer equipment, including memory and processing
Device is stored with computer-readable instruction in the memory, when the computer-readable instruction is executed by the processor, so that
The processor executes the step of localization method of RAM leakage described above.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of storage Jie for being stored with computer-readable instruction
Matter, when the computer-readable instruction is executed by one or more processors, so that one or more processors execute above-mentioned institute
The step of stating the localization method of RAM leakage.
The beneficial effect of the embodiment of the present invention is: by obtaining the memory information of target object, and sentencing in memory information
Disconnected whether there is records corresponding RR release record with the creation of target memory, when it be not present, can confirm in the target object
It deposits and is not released, be RAM leakage object, this method, which only needs to record the creation record of memory and RR release record, to be looked into
Ask, method is simple, by memory information carry out visual setting can also intuitive audit memory occupancy situation.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for
For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 is a kind of basic procedure schematic diagram of the localization method of RAM leakage provided in an embodiment of the present invention;
Fig. 2 is a kind of basic procedure schematic diagram of the generation method of memory information provided in an embodiment of the present invention;
Fig. 3 is whether a kind of creation information for judging multiple objects provided in an embodiment of the present invention all has corresponding release
The basic procedure schematic diagram of the method for information;
Fig. 4 is that another kind provided in an embodiment of the present invention judges whether the creation information of multiple objects all has corresponding release
Put the basic procedure schematic diagram of the method for information;
Fig. 5 is the basic procedure for the method that a kind of determining target object provided in an embodiment of the present invention is RAM leakage object
Schematic diagram;
Fig. 6 is a kind of positioning device basic structure block diagram of RAM leakage provided in an embodiment of the present invention;
Fig. 7 is computer equipment basic structure block diagram provided in an embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described.
In some processes of the description in description and claims of this specification and above-mentioned attached drawing, contain according to
Multiple operations that particular order occurs, but it should be clearly understood that these operations can not be what appears in this article suitable according to its
Sequence is executed or is executed parallel, and serial number of operation such as 101,102 etc. is only used for distinguishing each different operation, serial number
It itself does not represent and any executes sequence.In addition, these processes may include more or fewer operations, and these operations can
To execute or execute parallel in order.It should be noted that the description such as " first " herein, " second ", is for distinguishing not
Same message, equipment, module etc., does not represent sequencing, does not also limit " first " and " second " and be different type.
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 description, 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, those skilled in the art's every other implementation obtained without creative efforts
Example, shall fall within the protection scope of the present invention.
Embodiment
Those skilled in the art of the present technique are appreciated that " terminal " used herein above, " terminal device " both include wireless communication
The equipment of number receiver, only has the equipment of the wireless signal receiver of non-emissive ability, and including receiving and emitting hardware
Equipment, have on bidirectional communication link, can execute two-way communication reception and emit hardware equipment.This equipment
It may include: honeycomb or other communication equipments, shown with single line display or multi-line display or without multi-line
The honeycomb of device or other communication equipments;PCS (Personal Communications Service, PCS Personal Communications System), can
With combine voice, data processing, fax and/or communication ability;PDA (Personal Digital Assistant, it is personal
Digital assistants), it may include radio frequency receiver, pager, the Internet/intranet access, web browser, notepad, day
It goes through and/or GPS (Global Positioning System, global positioning system) receiver;Conventional laptop and/or palm
Type computer or other equipment, have and/or the conventional laptop including radio frequency receiver and/or palmtop computer or its
His equipment." terminal " used herein above, " terminal device " can be it is portable, can transport, be mounted on the vehicles (aviation,
Sea-freight and/or land) in, or be suitable for and/or be configured in local runtime, and/or with distribution form, operate in the earth
And/or any other position operation in space." terminal " used herein above, " terminal device " can also be communication terminal, on
Network termination, music/video playback terminal, such as can be PDA, MID (Mobile Internet Device, mobile Internet
Equipment) and/or mobile phone with music/video playing function, it is also possible to the equipment such as smart television, set-top box.
Client terminal in present embodiment is above-mentioned terminal.
Specifically, referring to Fig. 1, Fig. 1 is the basic procedure schematic diagram of the localization method of the present embodiment RAM leakage.
As shown in Figure 1, the localization method of RAM leakage includes the following steps:
S1100, the memory information for obtaining monitored object, wherein memory information includes the memory creation letter of multiple objects
Breath;
Object is programming term, refers to one section of region on memory, referred to as an object.In the present embodiment, in order to fixed
The leakage object of position memory, needs to be monitored the object, wherein the effect of monitoring is to obtain in Object Creation in real time
The memory that the creation instruction and release deposited have created releases order.
In practical applications, since object is generally associated in nested fashion, monitored object can be multiple
Object.For example, being monitored to the first object XX webpage, wherein XX webpage is monitored object, when user click XX net
When the first link of page, into the second object XX1 webpage, terminal or server create the memory of XX1 webpage.Wherein, second
Object XX1 webpage is nested with the first object XX webpage.
Memory information is used to indicate monitored object and multiple objects directly or indirectly nested with monitored object
The information of memory creation or RR release record, wherein memory information includes: the creation letter of all each objects for having created memory
The release information for the memory that breath and release have created.It should be noted that creation information and release information are in terminal or clothes
Business device receives creation instruction or generates after releasing order.For example, terminal receives creation instruction when user opens XX webpage,
It is instructed according to creation and generates creation information and be stored in memory information, when user closes XX webpage, terminal receives release and refers to
It enables, and by the storage of the release information of generation into memory information.
It is to be understood that whether memory information can be adopted graphically is directly viewable object all comprising creation information
With release information.Wherein, each object, the creation information of each object and release information correspond to each other in memory information.
S1200, judge whether the creation information of multiple objects all has corresponding release information;
In practical applications, it often will appear only creation information, do not discharge the object of information, which does not release
Memory is put, is considered the object that memory is leaked under normal circumstances.
In some embodiments, include the identification code of each object in memory information, create information or release information
It include the identification code of object, terminal or server can extract identification code when judging from memory information, according to identification code
Judge whether include same identification code release information, when do not include when, that is, can determine the object be target object.
In some embodiments, it in order to quickly judge, is inquired by uniline node.For example, multiple second
Object is nested with first object object, then when judging, using the first object as node, judges that multiple second objects nested therewith are
It is no that all there is release information, and so on.This method can choose multiple uniline nodes, while parallel carry out to multiple objects
Judgement, improves efficiency.
S1300, when there are it is no it is corresponding release information target object when, determine target object be RAM leakage pair
As.
In the present embodiment, target object is the object that only creation information does not discharge information.In practical applications, due to
The design problem of terminal program or other reasons, the memory of object do not discharge timely in the operation of meeting occupied terminal
It deposits, memory is caused to be leaked, after determining target object by the above method, developer can be carried out the memory of target object
Manual releasing, to solve the problems, such as leakage.
The localization method of above-mentioned RAM leakage by obtaining the memory information of target object, and judges in memory information
Corresponding RR release record is recorded with the presence or absence of the creation with target memory, when it be not present, can confirm the target object memory
It not being released, is RAM leakage object, this method, which only needs to record the creation record of memory and RR release record, to inquire,
Method is simple, by memory information carry out visual setting can also intuitive audit memory occupancy situation.
In some embodiments, memory information can record the creation information of each object using visual list
Or release information, such as memory information list can be used.The embodiment of the present invention provides a kind of generation method of memory information,
As shown in Fig. 2, Fig. 2 is a kind of basic procedure schematic diagram of the generation method of memory information provided in an embodiment of the present invention.
Specifically, as shown in Fig. 2, further including following step before step S1100:
S1110, object is monitored;
In the present embodiment, object to be monitored can be arranged program instruction to monitor the subobject of the object or the object
Memory creation or release, for example, following code can be used:
data(){return{bet:{pokerState:53,pokerHistory:'local'}}},
watch:{bet:{handler(newValue,oldValue){console.log(newValue)},d eep:
true}}
S1120, the memory for obtaining object create instruction;
Creation instruction is for creating object memory, for example, the instruction that webpage is opened in triggering is that creation refers to when opening webpage
It enables, wherein creation instruction can be to think to trigger, and can also be triggered by the design of terminal inner program.
S1130, the creation information for recording object in preset memory information list according to memory creation instruction.
Memory information list is for recording object information, for example, the identification code of object, the creation information of object memory and right
As the release information of memory, wherein object information and creation information and release information correspond.It should be noted that when pair
When not being released as memory, which does not discharge information.
In practical applications, storage create information during, terminal receive creation instruction after, automatically generate or
Person obtains the identification code of the object, and identification code and creation information comprising identification code are added in memory information list,
In, identification code and creation information correspond.It is corresponding, identification code is obtained after receiving memory and releasing order and is added to releases
It puts in information, and release information is added in memory information list according to above-mentioned method.
Whether the embodiment of the present invention provides a kind of creation information for judging multiple objects all with corresponding release information
Method, as shown in figure 3, Fig. 3 is whether a kind of creation information for judging multiple objects provided in an embodiment of the present invention all has pair
The basic procedure schematic diagram of the method for the release information answered.
Specifically, as shown in figure 3, step S1200 includes the following steps:
S1211, the identification code that object is extracted from memory information list;
In the embodiment of the present invention, memory information can be indicated with the mode of memory information list.Identification code is for only
The monitored all objects of one identification, wherein identification code can be not limited thereto using number, letter or character.
It should be noted that the identification code of the object stored in memory information list can be arranged in the way of nested
Column, can also be arranged according to the time sequencing of creation.When extracting identification code, can be extracted respectively in sequence.
S1212, judged in memory information list according to identification code with the presence or absence of the release with identification code with mapping relations
Information.
Terminal or server are inquired in memory information list according to identification code has mapping with the presence or absence of with identification code
The release information of relationship.
In some embodiments, terminal can also extract identification code from the release information of memory information list, and
The identification code for extracting whole objects in memory information, after the identification code extracted in removing release information in whole identification codes
Obtained remaining identification code, the as identification code without discharging information.That is, terminal is when judging, it can be determined that remaining identification
Whether code is 0, and when for 0, all objects in memory information all have release information, when there is remaining identification code, memory
Object in information has the object of not releasing memory.
In practical applications, monitored multiple objects are nest relation, for example, monitored object includes: first pair
As with the second object, wherein the second object is nested with the first object.Memory information is shown in a manner of memory information list
Show, and the identification code of the first object and the second object and creation information are in tree-shaped arrangement in memory information list.In order to can be fast
The target object for not discharging information is looked in quick checking, and whether the embodiment of the present invention provides another creation information for judging multiple objects
All with it is corresponding release information method, as shown in figure 4, Fig. 4 be another kind provided in an embodiment of the present invention judge it is multiple right
Whether the creation information of elephant all has the basic procedure schematic diagram of the method for corresponding release information.
Specifically, as shown in figure 4, step S1200 includes the following steps:
S1221, the information that the first object is obtained from memory information;
In the embodiment of the present invention, terminal according to the first object of information extraction of tree-like arrangement in memory information list letter
Breath, for example, extracting the identification code of the first object.In practical applications, for convenience, the object on tree-like top can be first extracted,
For example, an A object is nested with multiple B objects, each B object is again nested respectively at multiple C objects, and so on.It is extracting
When, in order to ensure comprehensive, do not occur to omit the identification code that can first extract A object.
It should be noted that the first object is used merely to indicate nest relation, in practical applications, the first object can be with
It is B object or C object.
S1222, all second pair nested with the first object is obtained from memory information according to the information of the first object
The information of elephant;
S1223, judge in the second object with the presence or absence of the object without discharging information.
In the embodiment of the present invention, due to the information in memory information list according to nest relation at tree-shaped arrangement, when
After determining the first object, it can determine second object nested with the first object, multiple second pairs are extracted in memory information
The identification code of elephant, and judge whether there is release information in each second object respectively.
For example, can determine that B object is the second object, and search each B respectively after determining A object is the first object
Whether all comprising release information in object.Similarly, in the present embodiment, the second object is exemplary, when the first object is A object
When, the second object is B object, and when the first object is B object, the second object is C object.
In practical applications, further include in all objects singleton object (singleton), wherein singleton object can be with
As the carrier of the storage configuration information in program, it can ensure that other objects read consistent information.For example, in some clothes
Be engaged in device, configuration information may be stored in database or file, read by some singleton object is unified, create object when
It waits and only needs directly to access singleton object, do not need additional creation memory.Therefore, singleton object memory can be deposited for a long time
, i.e., singleton object can only creation information, that is to say, that when it does not discharge information, and be not belonging to RAM leakage
Situation.Therefore, the embodiment of the present invention also provides a kind of method for the object that determining target object is RAM leakage, as shown in figure 5,
Fig. 5 is the basic procedure schematic diagram for the method that a kind of determining target object provided in an embodiment of the present invention is RAM leakage object.
Specifically, as shown in figure 5, step S1300 includes the following steps:
S1310, the identification code for obtaining target object;
In the embodiment of the present invention, terminal or server can extract the identification of target object from memory information list
Code.Specific method is referred to embodiment shown in Fig. 2, and details are not described herein.
S1320, judge whether target object is singleton object;
Terminal or server search the object information of target object according to identification code in memory information;Judge that object is believed
Whether there is singleton label in breath.
Wherein, object information is used to indicate the relevant information of the memory about target object, can be creation information, can also
Think the information including creation information, identification code.Singleton label is for indicating that object is singleton object.In practical application
In, when object is singleton object, in memory information list in advance when the object record creates information, add in creation information
Singleton is added to mark, wherein singleton label can be one group or a variety of combinations in letter, number, character.
In the embodiment of the present invention, terminal or server can be inquired in memory information in inquiry according to identification code
Creation information with same identification code, then singleton label is searched from creation information.When inquiring singleton label, mesh is determined
Mark object is singleton object.In the embodiment of the present invention, when creating has singleton information in information, it can determine that target object is single
Example object, that is, the target object is not the object of RAM leakage.
S1330, when target object is not singleton object, determine target object be RAM leakage object.
When inquiry is less than singleton label, determining target object not is singleton object, that is, the target object is RAM leakage
Object.
The embodiment of the present invention also provides a kind of positioning device of RAM leakage to solve above-mentioned technical problem.Referring specifically to
Fig. 6, Fig. 6 are the positioning device basic structure block diagram of the present embodiment RAM leakage.
As shown in fig. 6, a kind of positioning device of RAM leakage, comprising: obtain module 2100, processing module 2200 and execute
Module 2300.Wherein, module 2100 is obtained, for obtaining the memory information of monitored object, wherein the memory information packet
Include the creation information of the memory of multiple objects;Processing module 2200, for whether all to judge the creation information of the multiple object
With corresponding release information;Execution module 2300, for determining when there are the target object of no corresponding release information
The target object is the object of RAM leakage.
The positioning device of RAM leakage judges whether to deposit in memory information by obtaining the memory information of target object
Record corresponding RR release record in the creation with target memory, when it be not present, can confirm the target object memory not by
It discharges, is RAM leakage object, this method, which only needs to record the creation record of memory and RR release record, to inquire, method letter
It is single, by memory information carry out visual setting can also intuitive audit memory occupancy situation.
In some embodiments, further includes: the first processing submodule, for being monitored to the object;First obtains
Submodule is taken, the memory for obtaining the object creates instruction;According to memory creation instruction in preset memory information
The creation information of the object is recorded in list.
In some embodiments, the memory information is that record has the creation information of multiple objects and discharges the interior of information
Deposit information list;The processing module includes: the second acquisition submodule, for extracting object from the memory information list
Identification code;Second processing submodule, for according to the identification code judge in the memory information list whether there is with it is described
Identification code has the release information of mapping relations.
In some embodiments, the object includes: the first object and the second object, wherein the second object and first
Object is nested;The creation information of the first object and the second object is in tree-shaped arrangement in memory information;The processing module includes:
Three acquisition submodules, for obtaining the information of first object;Third handles submodule, for according to first object
Information obtains the information of all second objects nested with first object from the memory information;Fourth process submodule
Block, for judging in second object with the presence or absence of the object without discharging information.
In some embodiments, the execution module includes: third acquisition submodule, for obtaining the target object
Identification code;Fourth process submodule, for judging whether the target object is singleton object;First implementation sub-module is used
In when the target object is not singleton object, determine the target object be RAM leakage object.
In some embodiments, the fourth process submodule includes: the 5th processing submodule, for according to
Identification code searches the object information of the target object in the memory information;6th processing submodule, it is described for judging
Whether there is singleton label in object information.
In order to solve the above technical problems, the embodiment of the present invention also provides computer equipment.It is this referring specifically to Fig. 7, Fig. 7
Embodiment computer equipment basic structure block diagram.
As shown in fig. 7, the schematic diagram of internal structure of computer equipment.As shown in fig. 7, the computer equipment includes passing through to be
Processor, non-volatile memory medium, memory and the network interface of bus of uniting connection.Wherein, the computer equipment is non-easy
The property lost storage medium is stored with operating system, database and computer-readable instruction, can be stored with control information sequence in database
Column, when which is executed by processor, may make processor to realize a kind of localization method of RAM leakage.The meter
The processor of machine equipment is calculated for providing calculating and control ability, supports the operation of entire computer equipment.The computer equipment
Memory in can be stored with computer-readable instruction, when which is executed by processor, may make processor
Execute a kind of localization method of RAM leakage.The network interface of the computer equipment is used for and terminal connection communication.This field skill
Art personnel are appreciated that structure shown in Fig. 7, only the block diagram of part-structure relevant to application scheme, not structure
The restriction for the computer equipment that pairs of application scheme is applied thereon, specific computer equipment may include than institute in figure
Show more or fewer components, perhaps combines certain components or with different component layouts.
Processor obtains module 2100, processing module 2200 and execution module for executing in present embodiment in Fig. 6
2300 particular content, program code and Various types of data needed for memory is stored with the above-mentioned module of execution.Network interface is used for
To the data transmission between user terminal or server.Memory in present embodiment is stored with the localization method of RAM leakage
Program code and data needed for middle all submodules of execution, server is capable of the program code of invoking server and data execute
The function of all submodules.
Computer equipment is judged whether there is in memory information and target by obtaining the memory information of target object
The creation of memory records corresponding RR release record, when it be not present, can confirm that the target object memory is not released, be
RAM leakage object, this method, which only needs to record the creation record of memory and RR release record, to inquire, and method is simple, by right
Memory information carry out visual setting can also intuitive audit memory occupancy situation.
The present invention also provides a kind of storage mediums for being stored with computer-readable instruction, and the computer-readable instruction is by one
When a or multiple processors execute, so that one or more processors execute the positioning of RAM leakage described in any of the above-described embodiment
The step of method.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, which can be stored in a computer-readable storage and be situated between
In matter, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, storage medium above-mentioned can be
The non-volatile memory mediums such as magnetic disk, CD, read-only memory (Read-Only Memory, ROM) or random storage note
Recall body (Random Access Memory, RAM) etc..
It should be understood that although each step in the flow chart of attached drawing is successively shown according to the instruction of arrow,
These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps
Execution there is no stringent sequences to limit, can execute in the other order.Moreover, at least one in the flow chart of attached drawing
Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps
Completion is executed, but can be executed at different times, execution sequence, which is also not necessarily, successively to be carried out, but can be with other
At least part of the sub-step or stage of step or other steps executes in turn or alternately.
The above is only some embodiments of the invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (10)
1. a kind of localization method of RAM leakage characterized by comprising
Obtain the memory information of monitored object, wherein the memory information includes the creation information of the memory of multiple objects;
Judge whether the creation information of the multiple object all has corresponding release information;
When there are the target object of no corresponding release information, determine that the target object is the object of RAM leakage.
2. the localization method of RAM leakage according to claim 1, which is characterized in that the monitored object of the acquisition
Before memory information, further includes:
The object is monitored;
Obtain the memory creation instruction of the object;
The creation information of the object is recorded in preset memory information list according to memory creation instruction.
3. the localization method of RAM leakage according to claim 1, which is characterized in that the memory information has more for record
The memory information list of the creation information and release information of a object;All whether the creation information for judging the multiple object
With corresponding release information, comprising:
The identification code of object is extracted from the memory information list;
Judge that there is releasing for mapping relations with the presence or absence of with the identification code in the memory information list according to the identification code
Put information.
4. the localization method of RAM leakage according to claim 1, which is characterized in that the object includes: the first object
With the second object, wherein the second object is nested with the first object;The creation information of first object and the second object in memory information
In tree-shaped arrangement;Whether the creation information for judging the multiple object all has corresponding release information, comprising:
Obtain the information of first object;
All second nested with first object are obtained from the memory information according to the information of first object
The information of object;
Judge in second object with the presence or absence of the object without discharging information.
5. the localization method of RAM leakage according to claim 1, which is characterized in that the determination target object is
The object of RAM leakage, comprising:
Obtain the identification code of the target object;
Judge whether the target object is singleton object;
When the target object is not singleton object, determine the target object be RAM leakage, object.
6. the localization method of RAM leakage according to claim 5, which is characterized in that described to judge that the target object is
No is singleton object, comprising:
The object information of the target object is searched in the memory information according to the identification code;
Judge whether there is singleton label in the object information.
7. a kind of positioning device of RAM leakage characterized by comprising
Module is obtained, for obtaining the memory information of monitored object, wherein the memory information includes the interior of multiple objects
The creation information deposited;
Processing module, for judging whether the creation information of the multiple object all has corresponding release information;
Execution module, for determining that the target object is memory when there are the target object of no corresponding release information
The object of leakage.
8. the positioning device of RAM leakage according to claim 7, which is characterized in that further include:
First processing submodule, for being monitored to the object;
First acquisition submodule, the memory for obtaining the object create instruction;
The creation information of the object is recorded in preset memory information list according to memory creation instruction.
9. a kind of computer equipment, including memory and processor, it is stored with computer-readable instruction in the memory, it is described
When computer-readable instruction is executed by the processor, so that the processor executes such as any one of claims 1 to 6 right
It is required that the step of localization method of the RAM leakage.
10. a kind of storage medium for being stored with computer-readable instruction, the computer-readable instruction is handled by one or more
When device executes, so that one or more processors execute the RAM leakage as described in any one of claims 1 to 6 claim
The step of localization method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910199036.XA CN110083525A (en) | 2019-03-15 | 2019-03-15 | Localization method, device, computer equipment and the storage medium of RAM leakage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910199036.XA CN110083525A (en) | 2019-03-15 | 2019-03-15 | Localization method, device, computer equipment and the storage medium of RAM leakage |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110083525A true CN110083525A (en) | 2019-08-02 |
Family
ID=67412492
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910199036.XA Pending CN110083525A (en) | 2019-03-15 | 2019-03-15 | Localization method, device, computer equipment and the storage medium of RAM leakage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110083525A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110851281A (en) * | 2019-11-13 | 2020-02-28 | 北京无限光场科技有限公司 | Method, server, terminal, system and storage medium for detecting memory leakage |
CN111309507A (en) * | 2020-02-13 | 2020-06-19 | 支付宝(杭州)信息技术有限公司 | Memory leak detection method and device and machine-readable storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101339535A (en) * | 2008-08-21 | 2009-01-07 | 金蝶软件(中国)有限公司 | Method and device for monitoring application program performance |
CN102866947A (en) * | 2012-08-29 | 2013-01-09 | 深圳市共进电子股份有限公司 | Method for detecting internal memory leakage of Linux kernel |
CN103514026A (en) * | 2013-09-27 | 2014-01-15 | 摩卡软件(天津)有限公司 | Method for directly calling java api through javascript |
CN105701034A (en) * | 2014-12-14 | 2016-06-22 | 上海兆芯集成电路有限公司 | Cache memory budgeted by ways on memory access type |
CN106776342A (en) * | 2017-01-03 | 2017-05-31 | 百度在线网络技术(北京)有限公司 | The method and apparatus that a kind of memory object to Mobile solution is analyzed |
CN107562586A (en) * | 2017-08-16 | 2018-01-09 | 努比亚技术有限公司 | A kind of internal-memory detection method, equipment and computer-readable storage medium |
-
2019
- 2019-03-15 CN CN201910199036.XA patent/CN110083525A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101339535A (en) * | 2008-08-21 | 2009-01-07 | 金蝶软件(中国)有限公司 | Method and device for monitoring application program performance |
CN102866947A (en) * | 2012-08-29 | 2013-01-09 | 深圳市共进电子股份有限公司 | Method for detecting internal memory leakage of Linux kernel |
CN103514026A (en) * | 2013-09-27 | 2014-01-15 | 摩卡软件(天津)有限公司 | Method for directly calling java api through javascript |
CN105701034A (en) * | 2014-12-14 | 2016-06-22 | 上海兆芯集成电路有限公司 | Cache memory budgeted by ways on memory access type |
CN106776342A (en) * | 2017-01-03 | 2017-05-31 | 百度在线网络技术(北京)有限公司 | The method and apparatus that a kind of memory object to Mobile solution is analyzed |
CN107562586A (en) * | 2017-08-16 | 2018-01-09 | 努比亚技术有限公司 | A kind of internal-memory detection method, equipment and computer-readable storage medium |
Non-Patent Citations (2)
Title |
---|
徐正威;周琼;许珂;韩海;: "浅谈Java与C++中的内存管理", 网络安全技术与应用, no. 03, pages 50 - 51 * |
葛瑶;李晓风;孔德光;: "基于红黑树的堆内存泄漏动态检测技术", 计算机工程, no. 16, pages 165 - 167 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110851281A (en) * | 2019-11-13 | 2020-02-28 | 北京无限光场科技有限公司 | Method, server, terminal, system and storage medium for detecting memory leakage |
CN111309507A (en) * | 2020-02-13 | 2020-06-19 | 支付宝(杭州)信息技术有限公司 | Memory leak detection method and device and machine-readable storage medium |
CN111309507B (en) * | 2020-02-13 | 2022-05-10 | 支付宝(杭州)信息技术有限公司 | Memory leak detection method and device and machine-readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110096437A (en) | The test method and Related product of micro services framework | |
US11636090B2 (en) | Method and system for graph-based problem diagnosis and root cause analysis for IT operation | |
CN103562863A (en) | Creating a correlation rule defining a relationship between event types | |
CN109726091B (en) | Log management method and related device | |
CN109542412A (en) | Interface message generation method, device, computer equipment and storage medium | |
CN109120794B (en) | message display method and device and electronic equipment | |
CN108416041A (en) | Voice log analysis method and system | |
CN105243329B (en) | The method and device of android system bug excavation | |
CN110083525A (en) | Localization method, device, computer equipment and the storage medium of RAM leakage | |
CN107911448A (en) | Content pushing method and device | |
CN109885474A (en) | Test case edit methods and device, terminal and computer readable storage medium | |
US20200073738A1 (en) | Error incident fingerprinting with unique static identifiers | |
CN109189668A (en) | Interface test method, device, computer equipment and storage medium | |
CN106557300A (en) | A kind of function stack information of wild pointer determines method, device and electronic equipment | |
CN108958969B (en) | Database disaster recovery method, device and disaster recovery and backup systems | |
CN106302107A (en) | The method and device of preview instant communication information | |
CN110532107A (en) | Interface call method, device, computer equipment and storage medium | |
CN106682146B (en) | Method and system for retrieving scenic spot evaluation according to keywords | |
US9069874B2 (en) | Webpage content search method and system | |
CN108959046A (en) | A kind of information processing method, equipment and device | |
CN105573756B (en) | A kind of script language extensions method and event bus framework | |
CN113468613A (en) | Log file processing method and device | |
CN110175276A (en) | Infringing information acquisition methods, device, computer equipment and storage medium | |
JP7173619B2 (en) | Vulnerability information management device, vulnerability information management method, and program | |
CN112685247A (en) | Alarm suppression method based on Zabbix monitoring system and monitoring system |
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 |