CN106844216A - The localization method and system of a kind of RAM leakage - Google Patents
The localization method and system of a kind of RAM leakage Download PDFInfo
- Publication number
- CN106844216A CN106844216A CN201710060920.6A CN201710060920A CN106844216A CN 106844216 A CN106844216 A CN 106844216A CN 201710060920 A CN201710060920 A CN 201710060920A CN 106844216 A CN106844216 A CN 106844216A
- Authority
- CN
- China
- Prior art keywords
- internal memory
- linked list
- identity information
- circular linked
- memory
- 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
Classifications
-
- 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/3636—Software debugging by tracing the execution of the program
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses the localization method and system of a kind of RAM leakage, methods described includes:When application internal memory operation is monitored, the identity information of storage allocation for application is obtained;The identity information is saved in default circular linked list node, nodal information is generated;When monitoring that releasing memory is operated, the identity information according to releasing memory travels through the circular linked list, the nodal information that lookup matches with the identity information of the releasing memory, and the nodal information that will be found and is deleted from the circular linked list;According to the internal memory of remaining nodal information positioning leakage in the circular linked list.A kind of localization method of RAM leakage provided in an embodiment of the present invention, realizes the purpose of the quickly and efficiently source code position of positioning RAM leakage.
Description
Technical field
The present embodiments relate to technical field of measurement and test, more particularly to a kind of RAM leakage localization method and system.
Background technology
In computer science, memory overflow refers to not used because carelessness or mistake cause program to fail release
Internal memory situation.Memory overflow is not necessarily referring to internal memory disappearance physically, but after application assigned section internal memory, due to
Programming error, loses to this section of control of internal memory, causes this section of internal memory to be used again, and has thus resulted in internal memory
Waste.
One small RAM leakage may not be needed to note very much, but if program leakage bulk memory, or incremental
Leakage internal memory can cause following phenomenons:Systematic function reduction before this, then causes the internal memory of complexity to exhaust mistake;The worst situation
It is that a RAM leakage program may run out very many internal memories and cause other programs to malfunction, and user not can know that mistake
By mistake on earth from where.In addition, one looks the little RAM leakage of harm, it may be possible to the tendency of another problem.Therefore,
The generation of RAM leakage phenomenon is avoided as far as possible, RAM leakage is avoided, except requiring that there is programming personnel good coding to practise
Outside used and coding criterion, key will also start with from program code, and efficient, the reliable detection and localization of row is leaked into internal memory,
Once discovery procedure exception, facilitates programming personnel to carry out necessary modification to program.
The content of the invention
The localization method and system of a kind of RAM leakage are the embodiment of the invention provides, to realize quickly positioning RAM leakage
Source code position.
In a first aspect, the embodiment of the invention provides a kind of localization method of RAM leakage, the method includes:
When application internal memory operation is monitored, the identity information of storage allocation for application is obtained;
The identity information is saved in default circular linked list node, nodal information is generated;
When monitoring that releasing memory is operated, identity information according to releasing memory travels through the circular linked list, search with
The nodal information that the identity information of the releasing memory matches, and the nodal information that will be found deletes from the circular linked list
Remove;
According to the internal memory of remaining nodal information positioning leakage in the circular linked list.
Further, it is described when application internal memory operation is monitored, the identity information of storage allocation for application is obtained,
Including:
When monitoring to call internal memory application function to apply for internal memory, it is determined that in the presence of application internal memory operation;
Identity information for application institute storage allocation is obtained by heavily loaded internal memory application function.
Further, the identity information is saved in default circular linked list node, before generation nodal information, also
Including:
Detect whether the default circular linked list has been present, if then perform the identity information is saved in it is default
Circular linked list node in, generate the operation of nodal information, otherwise, create default circular linked list and circular linked list node.
Further, it is described when monitoring that releasing memory is operated, followed described in the identity information traversal according to releasing memory
Loop chain table, the nodal information that matches with the identity information of the releasing memory of lookup, and the nodal information that will be found are from institute
Deletion in circular linked list is stated, including:
When monitoring to call internal memory release function to carry out releasing memory, it is determined that there is releasing memory operation;
The identity information that function obtains releasing memory is discharged by heavily loaded internal memory;
Identity information according to the releasing memory travels through the circular linked list, searches and believes with the identity of the releasing memory
The nodal information of manner of breathing matching, and the nodal information that will be found deletes from the circular linked list.
Further, the internal memory according to remaining nodal information positioning leakage in the circular linked list, including:
When setting triggering command is received, remaining nodal information in the circular linked list is recorded in the form of a file
To in file system, for the internal memory of inquiry leakage.
Further, the identity information includes:Call the filename of internal memory application function, call internal memory application function
Function name, at least one for applying in successful memory address, internal memory application time and source code lines positional information.
Second aspect, the embodiment of the present invention additionally provides a kind of alignment system of RAM leakage, and the system includes:
Acquisition module, for when application internal memory operation is monitored, obtaining the identity information of storage allocation for application;
Preserving module, for the identity information to be saved in default circular linked list node, generates nodal information;
Removing module, for when monitoring that releasing memory is operated, being followed described in the identity information traversal according to releasing memory
Loop chain table, the nodal information that matches with the identity information of the releasing memory of lookup, and the nodal information that will be found are from institute
State deletion in circular linked list;
Locating module, for the internal memory according to remaining nodal information positioning leakage in the circular linked list.
Further, the acquisition module includes:Application internal memory operation determining unit, for monitoring to call internal memory Shen
Please function apply during internal memory, it is determined that in the presence of application internal memory operation;First acquisition unit, for by heavily loaded internal memory application function
Obtain the identity information for application institute storage allocation;
The removing module includes:Releasing memory operation determination unit, for monitoring to call internal memory to discharge function
During releasing memory, it is determined that there is releasing memory operation;Second acquisition unit, release is obtained for discharging function by heavily loaded internal memory
The identity information of internal memory;Delete unit, for traveling through the circular linked list according to the identity information of the releasing memory, search with
The nodal information that the identity information of the releasing memory matches, and the nodal information that will be found deletes from the circular linked list
Remove;
The locating module specifically for when receive setting triggering command when, by remaining node in the circular linked list
Information recorded in file system in the form of a file, for the internal memory of inquiry leakage;
The identity information includes:The filename for calling internal memory application function, function name, the Shen of calling internal memory application function
Please successfully in memory address, internal memory application time and source code lines positional information at least one.
Further, the system also includes:
Detection module, for the identity information to be saved in default circular linked list node, generates nodal information
Before, detect whether the default circular linked list has been present, if then perform the identity information is saved in it is default
In circular linked list node, the operation of nodal information is generated, otherwise, create default circular linked list and circular linked list node.
A kind of localization method of RAM leakage provided in an embodiment of the present invention, by monitor application internal memory operation when,
The identity information of storage allocation for application is obtained, and the identity information is saved in default circular linked list node,
Generation nodal information;When monitoring that releasing memory is operated, the identity information according to releasing memory travels through the circular linked list, looks into
Look for the nodal information matched with the identity information of the releasing memory, and the nodal information that will be found is from the circular linked list
Middle deletion;Finally according to the technological means of the internal memory of remaining nodal information positioning leakage in the circular linked list, realize fast
The purpose of source code position that is fast and efficiently locating RAM leakage.
Brief description of the drawings
Fig. 1 is a kind of localization method schematic flow sheet of RAM leakage that the embodiment of the present invention one is provided;
Fig. 2 is a kind of localization method schematic flow sheet of RAM leakage that the embodiment of the present invention two is provided;
Fig. 3 is a kind of localization method schematic flow sheet of RAM leakage that the embodiment of the present invention three is provided;
Fig. 4 is a kind of localization method schematic flow sheet of RAM leakage that the embodiment of the present invention four is provided;
Fig. 5 is that a kind of flow of internal memory application in the main program of application program operation that the embodiment of the present invention four is provided is shown
It is intended to;
Fig. 6 is that a kind of flow of memory discharge operation in the main program of application program that the embodiment of the present invention four is provided is shown
It is intended to;
Fig. 7 is that a kind of internal memory in the main program of application program that the embodiment of the present invention four is provided checks that the flow of operation is shown
It is intended to;
Fig. 8 is a kind of positioning system structure schematic diagram of RAM leakage that the embodiment of the present invention five is provided.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that, in order to just
Part rather than entire infrastructure related to the present invention is illustrate only in description, accompanying drawing.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail
The treatment described as flow chart or method.Although every step to be described as flow chart the treatment of order, therein to be permitted
Multi-step can be implemented concurrently, concomitantly or simultaneously.Additionally, the order of every step can be rearranged.When it
The treatment can be terminated when step is completed, it is also possible to have the additional step being not included in accompanying drawing.The treatment
Can correspond to method, function, code, subroutine, subprogram etc..
Embodiment one
Fig. 1 is a kind of localization method flow chart of RAM leakage that the embodiment of the present invention one is provided, and the method is applicable to
The internal memory revealed in the program debugging stage is to program carries out the situation of Quick finding and seeking, can be by the positioning of RAM leakage
System is performed.The system can be realized by way of hardware and/or software.The method specifically includes following steps:
Step 110, monitor application internal memory operation when, obtain for application and the identity information of storage allocation.
Generally, many standard library functions that can be directly invoked for having existed are had according to the programming language for being used,
Therefore the built-in function for realizing a certain concrete function can be directly invoked in software program, when in the absence of the built-in function for needing,
When needed, corresponding power function can be directly invoked with self-defined some power functions.
Can for example realize applying the function of internal memory by calling internal memory application function, in C language, to apply for one
Dram is needed comprising a header file i.e. " #include<malloc.h>" or " #include<stdlib.h>", then
The built-in function that application internal memory can just be directly invoked realizes the purpose of application internal memory, such as passes through code " void*malloc
(usigned size) " can obtain the internal memory of dynamically distributes, and the parameter of malloc functions is the memory size for needing application, can
To be configured;The return value of the function is the first address of the internal memory applied, the type of memory of return is void, can basis
Need to carry out return type conversion.To realize applying in C++ the function of internal memory then more it is simple some, it is necessary to comprising header file " #
include<iostream.h>", corresponding function need not be then so called when internal memory is applied for, as long as a keyword new
, such as " int*x;X=new int [] ", thus applies to a memory headroom for integer.When there is this in program
When a little specific keywords or internal memory application function, then it is assumed that monitored application internal memory operation, and then obtained for application
And the identity information of storage allocation.
Preferably, the identity information includes:The filename for calling internal memory application function is, the letter for calling internal memory application function
It is several, apply in successful memory address, internal memory application time and source code lines positional information at least one.
Specifically, the identity information can be obtained by the parameter of heavily loaded internal memory application function, detailed process is in this hair
Explained in bright embodiment two.
Step 120, the identity information is saved in default circular linked list node, generates nodal information.
Wherein, the circular linked list is a form of Linked Storage Structure, is characterized in last node in table
Pointer points to first node in head node, i.e. table, and whole chained list forms a ring, so either from which node in table
Traversing operation is proceeded by, all nodes that can be in traversal list, this is that non-circular linked list is irrealizable.
Step 130, when monitoring that releasing memory is operated, identity information according to releasing memory travels through the endless-chain
Table, the nodal information that lookup matches with the identity information of the releasing memory, and the nodal information that will be found are followed from described
Deleted in loop chain table.
Specifically, similar with application internal memory, releasing memory can discharge function realization by directly invoking internal memory, for example,
If realized by calling " malloc " or " realloc " function during application internal memory, can be by adjusting during releasing memory
Realized with " free " built-in function;If during application internal memory being realized by keyword " new ", can pass through during releasing memory
" delete " sentence is realized.Certainly the function of other application/releasing memories is can also be, the present embodiment is not limited it
It is fixed.
When the function or keyword of above-mentioned releasing memory is monitored, then it is assumed that monitored the operation of releasing memory;
Due to the memory address information that is released with applied for that successful memory address information was one-to-one originally, and be it is unique,
It is preferred, therefore, that the circular linked list can be traveled through according to the memory address information being released, the internal memory ground searched and be released
The nodal information of location information match, and the nodal information that will be found deletes from the circular linked list, to mark in the section
Deposit not compromised.
Step 140, the internal memory according to remaining nodal information positioning leakage in the circular linked list.
Often apply for one section of internal memory, all the internal memory identity information of application is saved in default circular linked list, often discharge one
Section internal memory, all deletes the internal memory identity information matched with the internal memory being released preserved in circular linked list, represents in the section
Deposit and be released, in the absence of the situation of RAM leakage, therefore, in circular linked list it is remaining without deleted nodal information just
It is the identity information of RAM leakage, the internal memory of leakage can be navigated to according to the identity information, to realize to the fast of RAM leakage
Speed positioning.
The localization method of a kind of RAM leakage that the present embodiment is provided, by when application internal memory operation is monitored, obtaining
The identity information of storage allocation for application, and the identity information is saved in default circular linked list node, generate
Nodal information;When monitoring that releasing memory is operated, identity information according to releasing memory travels through the circular linked list, search with
The nodal information that the identity information of the releasing memory matches, and the nodal information that will be found deletes from the circular linked list
Remove;Finally according to the technological means of the internal memory of remaining nodal information positioning leakage in the circular linked list, realize it is quick and
Efficiently locate the purpose of the source code position of RAM leakage.
Embodiment two
Fig. 2 is a kind of localization method schematic flow sheet of RAM leakage that the embodiment of the present invention two is provided, in embodiment one
On the basis of, to having carried out further optimization, referring specifically to shown in Fig. 2, the method specifically includes as follows the present embodiment:
Step 210, when monitoring to call internal memory application function to apply for internal memory, it is determined that in the presence of application internal memory operation.
Step 220, the identity information that application institute storage allocation is directed to by the acquisition of heavily loaded internal memory application function.
Wherein, overload function is a kind of special circumstances of function, that is, allow to state several function classes in same statement domain
As function of the same name, but the formal parameter of these functions of the same name must be different, the formal parameter can refer to specifically parameter
Number, type, or order etc., that is, same operator completes different calculation functions.
Therefore, it can the formal parameter by setting heavily loaded internal memory application function, be directed to by set parameter acquiring
The identity information of internal memory application function institute storage allocation, the identity information be, for example, call internal memory application function filename,
Call the function name of internal memory application function, apply for successful memory address, internal memory application time or source code lines positional information
Deng.
Whether step 230, the default circular linked list of detection have been present, if then performing step 250, otherwise, perform step
Rapid 240.
Step 240, the default circular linked list of establishment and circular linked list node.
Step 250, the identity information is saved in default circular linked list node, generates nodal information.
Step 260, when monitoring that releasing memory is operated, identity information according to releasing memory travels through the endless-chain
Table, the nodal information that lookup matches with the identity information of the releasing memory, and the nodal information that will be found are followed from described
Deleted in loop chain table.
Step 270, the internal memory according to remaining nodal information positioning leakage in the circular linked list.
A kind of localization method of RAM leakage that the present embodiment is provided, on the basis of above-described embodiment technical scheme, will
The operation optimization of " when application internal memory operation is monitored, obtaining the identity information of storage allocation for application " is " to work as monitoring
Apply during internal memory to internal memory application function is called, it is determined that in the presence of application internal memory operation, being obtained by heavily loaded internal memory application function
For the identity information of application institute storage allocation ", the purpose of the identity information for obtaining storage allocation accurately and in time is realized,
And then realize the purpose of quick positioning RAM leakage source code position.
Embodiment three
Fig. 3 is a kind of localization method schematic flow sheet of RAM leakage that the embodiment of the present invention three is provided, in above-mentioned each reality
Apply on the basis of example, the present embodiment has carried out further optimization, referring specifically to shown in Fig. 3, the method is specific as follows:
Step 310, monitor application internal memory operation when, obtain for application and the identity information of storage allocation.
Step 320, the identity information is saved in default circular linked list node, generates nodal information.
Step 330, when monitoring to call internal memory to discharge function and carry out releasing memory, it is determined that there is releasing memory operation.
Step 340, the identity information that function acquisition releasing memory is discharged by heavily loaded internal memory.
Step 350, the circular linked list is traveled through according to the identity information of the releasing memory, searched and the releasing memory
The nodal information that matches of identity information, and the nodal information that will be found deletes from the circular linked list.
Step 360, the internal memory according to remaining nodal information positioning leakage in the circular linked list.
A kind of localization method of RAM leakage that the present embodiment is provided, on the basis of above-described embodiment technical scheme, will
The operation optimization of " when monitoring that releasing memory is operated, obtaining the identity information of releasing memory " is " to monitor to call internal memory
When release function carrys out releasing memory, it is determined that there is releasing memory operation, discharging function by heavily loaded internal memory obtains releasing memory
Identity information ", realizes the purpose of the identity information for obtaining releasing memory accurately and in time, and then realizes in quick positioning
Deposit the purpose of leakage source code position.
Example IV
Fig. 4 is a kind of localization method schematic flow sheet of RAM leakage that the embodiment of the present invention four is provided, in above-mentioned each reality
Apply on the basis of example, the present embodiment has carried out further optimization, referring specifically to shown in Fig. 4, the method is specific as follows:
Step 410, monitor application internal memory operation when, obtain for application and the identity information of storage allocation.
Step 420, the identity information is saved in default circular linked list node, generates nodal information.
Step 430, when monitoring that releasing memory is operated, identity information according to releasing memory travels through the endless-chain
Table, the nodal information that lookup matches with the identity information of the releasing memory, and the nodal information that will be found are followed from described
Deleted in loop chain table.
Step 440, when receive setting triggering command when, by remaining nodal information in the circular linked list with file
Form recorded in file system, for the internal memory of inquiry leakage.
Specifically, the setting triggering command can be the instruction triggered by certain physical button, or program fortune
Row has arrived the instruction of certain special trigger flow, such as described special flow can enter a specific program mould
Block, or exit a specific program module.
In remaining nodal information in the circular linked list recorded into file system in the form of a file, facilitate
Relevant staff is inquired about the internal memory revealed.
A kind of localization method of RAM leakage that the present embodiment is provided, on the basis of above-described embodiment technical scheme, will
The operation optimization of " according to the internal memory of remaining nodal information positioning leakage in the circular linked list " is " to be triggered when setting is received
During instruction, during remaining nodal information in the circular linked list recorded into file system in the form of a file, so that inquiry is let out
The internal memory of dew ", facilitating staff carries out Query Location to the internal memory revealed, and then realizes quick positioning RAM leakage source
The purpose of code position.
On the basis of the various embodiments described above, it is possible to further determining RAM leakage provided in an embodiment of the present invention
Whether position scheme is nested into the main program of application program, by setting an internal memory detection switch to compiling this RAM leakage
Finder section is controlled, can be by closing internal memory detection switch by internal memory in the state of application program is normally run
The finder section of leakage is shielded, i.e., compiler is not compiled to the finder section of RAM leakage, thus will not
Occupying system resources, do not interfere with the compilation speed of application program yet;When discovery application program operation is abnormal, it is necessary to application
When program carries out the detection of RAM leakage with positioning, the internal memory detection switch can be opened, in the process of application program operation
In operation compiling is carried out to the finder of RAM leakage section simultaneously, you can realize the internal memory revealed in quick positioning application program
Purpose.The internal memory detection switch is preferably macro switch.
Specifically, the schematic flow sheet of the operation of the internal memory application in the main program of application program shown in Fig. 5 is may refer to,
The schematic flow sheet of memory discharge operation in the main program of application program shown in Fig. 6, the master in application program shown in Fig. 7
Internal memory checks the schematic flow sheet of operation in program;" return " operation last in flow chart represents the master for returning to application program
In program, other program codes are continued executing with.
Embodiment five
Fig. 8 is a kind of structural representation of the alignment system of RAM leakage that the embodiment of the present invention five is provided, referring specifically to
Shown in Fig. 8, the system specifically includes as follows:
Acquisition module 810, preserving module 820, removing module 830 and locating module 840;
Wherein, acquisition module 810, for when application internal memory operation is monitored, obtaining the storage allocation for application
Identity information;Preserving module 820, for the identity information to be saved in default circular linked list node, generation node letter
Breath;Removing module 830, for when monitoring that releasing memory is operated, the identity information according to releasing memory to travel through the circulation
Chained list, the nodal information that matches with the identity information of the releasing memory of lookup, and the nodal information that will be found are from described
Deleted in circular linked list;Locating module 840, for according in remaining nodal information positioning leakage in the circular linked list
Deposit.
Further, acquisition module 810 includes:Application internal memory operation determining unit, for monitoring to call internal memory Shen
Please function apply during internal memory, it is determined that in the presence of application internal memory operation;First acquisition unit, for by heavily loaded internal memory application function
Obtain the identity information for application institute storage allocation.
Further, removing module 830 includes:Releasing memory operation determination unit, for monitoring to call internal memory to release
When putting function and carrying out releasing memory, it is determined that there is releasing memory operation;Second acquisition unit, for discharging function by heavily loaded internal memory
Obtain the identity information of releasing memory;Unit is deleted, for traveling through the endless-chain according to the identity information of the releasing memory
Table, the nodal information that lookup matches with the identity information of the releasing memory, and the nodal information that will be found are followed from described
Deleted in loop chain table.
Further, locating module 840 in the circular linked list specifically for when setting triggering command is received, will remain
Remaining nodal information recorded in file system in the form of a file, for the internal memory of inquiry leakage.
Further, the identity information includes:Call the filename of internal memory application function, call internal memory application function
Function name, at least one for applying in successful memory address, internal memory application time and source code lines positional information.
Further, the system also includes:
Detection module, for the identity information to be saved in default circular linked list node, generates nodal information
Before, detect whether the default circular linked list has been present, if then perform the identity information is saved in it is default
In circular linked list node, the operation of nodal information is generated, otherwise, create default circular linked list and circular linked list node.
The alignment system of a kind of RAM leakage that the present embodiment is provided, by when application internal memory operation is monitored, obtaining
The identity information of storage allocation for application, and the identity information is saved in default circular linked list node, generate
Nodal information;When monitoring that releasing memory is operated, identity information according to releasing memory travels through the circular linked list, search with
The nodal information that the identity information of the releasing memory matches, and the nodal information that will be found deletes from the circular linked list
Remove;Finally according to the technological means of the internal memory of remaining nodal information positioning leakage in the circular linked list, realize it is quick and
Efficiently locate the purpose of the source code position of RAM leakage.
The said goods can perform the method that any embodiment of the present invention is provided, and possess the corresponding functional module of execution method
And beneficial effect.Not ins and outs of detailed description in the present embodiment, reference can be made to the side that any embodiment of the present invention is provided
Method.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that
The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious changes,
Readjust and substitute without departing from protection scope of the present invention.Therefore, although the present invention is carried out by above example
It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also
More other Equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.
Claims (10)
1. a kind of localization method of RAM leakage, it is characterised in that including:
When application internal memory operation is monitored, the identity information of storage allocation for application is obtained;
The identity information is saved in default circular linked list node, nodal information is generated;
When monitoring that releasing memory is operated, identity information according to releasing memory travels through the circular linked list, search with it is described
The nodal information that the identity information of releasing memory matches, and the nodal information that will be found deletes from the circular linked list;
According to the internal memory of remaining nodal information positioning leakage in the circular linked list.
2. method according to claim 1, it is characterised in that described when application internal memory operation is monitored, acquisition is directed to
Apply and the identity information of storage allocation, including:
When monitoring to call internal memory application function to apply for internal memory, it is determined that in the presence of application internal memory operation;
Identity information for application institute storage allocation is obtained by heavily loaded internal memory application function.
3. method according to claim 2, it is characterised in that the identity information is saved in default circular linked list section
In point, before generation nodal information, also include:
Detect whether the default circular linked list has been present, if then perform for the identity information to be saved in default following
In ring chained list node, the operation of nodal information is generated, otherwise, create default circular linked list and circular linked list node.
4. method according to claim 1, it is characterised in that described when monitoring that releasing memory is operated, according to release
The identity information of internal memory travels through the circular linked list, searches the nodal information matched with the identity information of the releasing memory,
And the nodal information that will be found is deleted from the circular linked list, including:
When monitoring to call internal memory release function to carry out releasing memory, it is determined that there is releasing memory operation;
The identity information that function obtains releasing memory is discharged by heavily loaded internal memory;
Identity information according to the releasing memory travels through the circular linked list, searches the identity information phase with the releasing memory
The nodal information of matching, and the nodal information that will be found deletes from the circular linked list.
5. method according to claim 1, it is characterised in that described according to remaining nodal information in the circular linked list
The internal memory of leakage is positioned, including:
When setting triggering command is received, remaining nodal information in the circular linked list be recorded into text in the form of a file
In part system, for the internal memory of inquiry leakage.
6. the method according to claim any one of 1-5, it is characterised in that the identity information includes:Call internal memory Shen
Please function filename, call the function name of internal memory application function, apply for successful memory address, internal memory application time and source generation
Code row positional information at least one.
7. a kind of alignment system of RAM leakage, it is characterised in that including:
Acquisition module, for when application internal memory operation is monitored, obtaining the identity information of storage allocation for application;
Preserving module, for the identity information to be saved in default circular linked list node, generates nodal information;
Removing module, for when monitoring that releasing memory is operated, the identity information according to releasing memory to travel through the endless-chain
Table, the nodal information that lookup matches with the identity information of the releasing memory, and the nodal information that will be found are followed from described
Deleted in loop chain table;
Locating module, for the internal memory according to remaining nodal information positioning leakage in the circular linked list.
8. system according to claim 7, it is characterised in that
The acquisition module includes:Application internal memory operation determining unit, for monitoring to call internal memory application function to apply
During internal memory, it is determined that in the presence of application internal memory operation;First acquisition unit, for being obtained for application by heavily loaded internal memory application function
The identity information of institute's storage allocation;
The removing module includes:Releasing memory operation determination unit, for monitoring to call internal memory to discharge function to discharge
During internal memory, it is determined that there is releasing memory operation;Second acquisition unit, releasing memory is obtained for discharging function by heavily loaded internal memory
Identity information;Delete unit, for traveling through the circular linked list according to the identity information of the releasing memory, search with it is described
The nodal information that the identity information of releasing memory matches, and the nodal information that will be found deletes from the circular linked list;
The locating module specifically for when receive setting triggering command when, by remaining nodal information in the circular linked list
In recorded file system in the form of a file, for the internal memory of inquiry leakage.
9. system according to claim 8, it is characterised in that also include:
Detection module, for the identity information to be saved in default circular linked list node, before generation nodal information,
Detect whether the default circular linked list has been present, if then perform for the identity information to be saved in default endless-chain
In table node, the operation of nodal information is generated, otherwise, create default circular linked list and circular linked list node.
10. the system according to claim any one of 7-9, it is characterised in that
The identity information includes:The filename of internal memory application function is called, the function name of internal memory application function is called, is applied into
At least one in the memory address of work(, internal memory application time and source code lines positional information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710060920.6A CN106844216A (en) | 2017-01-25 | 2017-01-25 | The localization method and system of a kind of RAM leakage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710060920.6A CN106844216A (en) | 2017-01-25 | 2017-01-25 | The localization method and system of a kind of RAM leakage |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106844216A true CN106844216A (en) | 2017-06-13 |
Family
ID=59121249
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710060920.6A Pending CN106844216A (en) | 2017-01-25 | 2017-01-25 | The localization method and system of a kind of RAM leakage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106844216A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108108258A (en) * | 2017-12-29 | 2018-06-01 | 杭州迪普科技股份有限公司 | The restorative procedure and device of a kind of RAM leakage |
CN108664394A (en) * | 2018-04-10 | 2018-10-16 | 北京奇安信科技有限公司 | A kind of RAM leakage process tracing method and device |
CN108984295A (en) * | 2018-06-19 | 2018-12-11 | 珠海全志科技股份有限公司 | Method for recovering internal storage, computer installation and computer readable storage medium |
CN110704176A (en) * | 2019-08-19 | 2020-01-17 | 深圳英飞拓科技股份有限公司 | Method and device for monitoring residual memory of system heap |
CN113835992A (en) * | 2020-06-23 | 2021-12-24 | 北京字节跳动网络技术有限公司 | Memory leak processing method and device, electronic equipment and computer storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101587455A (en) * | 2008-12-11 | 2009-11-25 | 南京南瑞继保电气有限公司 | Method for checking memory leak for vxWorks operating system |
CN103914376A (en) * | 2014-03-12 | 2014-07-09 | 汉柏科技有限公司 | Method for rapidly positioning memory leak |
US8880757B1 (en) * | 2013-09-24 | 2014-11-04 | International Business Machines Corporation | RDMA resource leakage detection and reporting |
-
2017
- 2017-01-25 CN CN201710060920.6A patent/CN106844216A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101587455A (en) * | 2008-12-11 | 2009-11-25 | 南京南瑞继保电气有限公司 | Method for checking memory leak for vxWorks operating system |
US8880757B1 (en) * | 2013-09-24 | 2014-11-04 | International Business Machines Corporation | RDMA resource leakage detection and reporting |
CN103914376A (en) * | 2014-03-12 | 2014-07-09 | 汉柏科技有限公司 | Method for rapidly positioning memory leak |
Non-Patent Citations (1)
Title |
---|
项响琴: "《C语言程序设计》", 31 August 2016 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108108258A (en) * | 2017-12-29 | 2018-06-01 | 杭州迪普科技股份有限公司 | The restorative procedure and device of a kind of RAM leakage |
CN108108258B (en) * | 2017-12-29 | 2020-11-06 | 杭州迪普科技股份有限公司 | Memory leak repairing method and device |
CN108664394A (en) * | 2018-04-10 | 2018-10-16 | 北京奇安信科技有限公司 | A kind of RAM leakage process tracing method and device |
CN108984295A (en) * | 2018-06-19 | 2018-12-11 | 珠海全志科技股份有限公司 | Method for recovering internal storage, computer installation and computer readable storage medium |
CN108984295B (en) * | 2018-06-19 | 2020-08-07 | 珠海全志科技股份有限公司 | Memory recovery method, computer device and computer readable storage medium |
CN110704176A (en) * | 2019-08-19 | 2020-01-17 | 深圳英飞拓科技股份有限公司 | Method and device for monitoring residual memory of system heap |
CN113835992A (en) * | 2020-06-23 | 2021-12-24 | 北京字节跳动网络技术有限公司 | Memory leak processing method and device, electronic equipment and computer storage medium |
CN113835992B (en) * | 2020-06-23 | 2023-10-20 | 抖音视界有限公司 | Memory leakage processing method and device, electronic equipment and computer storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106844216A (en) | The localization method and system of a kind of RAM leakage | |
US5854924A (en) | Static debugging tool and method | |
KR101099212B1 (en) | An intermediate representation for multiple exception handling models | |
US7392514B2 (en) | Data flow chasing | |
EP2829970B1 (en) | A method and apparatus for porting source code | |
US10489150B2 (en) | Software dependency shading | |
US20130007709A1 (en) | Software configuration management | |
JP7212793B2 (en) | METHOD, APPARATUS AND COMPUTER STORAGE MEDIUM FOR IMPLEMENTING FUNCTION JUMP | |
Doan et al. | Verifying heterogeneous multi-agent programs | |
Babati et al. | Static analysis toolset with Clang | |
CN114462044A (en) | UEFI (unified extensible firmware interface) firmware vulnerability static detection method and device based on taint analysis | |
Tanaka et al. | A study on the current status of functional idioms in Java | |
CN107526966B (en) | Composite stain propagation tracking method for Android platform | |
CN103677746A (en) | Instruction recombining method and device | |
CN114691197A (en) | Code analysis method and device, electronic equipment and storage medium | |
Mesnard et al. | Towards a framework for algorithm recognition in binary code | |
Bedadala et al. | Generation of Call Graph for Java Higher Order Functions | |
Dagenais et al. | Clones occurence in large object oriented software packages | |
CN110096888A (en) | A kind of method and system for accelerating verifying and analysis SMM security risk | |
Yang et al. | 1dFuzz: Reproduce 1-Day Vulnerabilities with Directed Differential Fuzzing | |
CN117235746B (en) | Source code safety control platform based on multidimensional AST fusion detection | |
CN113326048B (en) | Floating point number calculation precision processing method, system, medium and device | |
CN117555811B (en) | Embedded software analysis method, device and storage medium based on static symbol execution | |
KR102271273B1 (en) | Process wrapping method for evading anti-analysis of native codes, recording medium and device for performing the method | |
Hai et al. | Multi-threaded on-the-fly model generation of malware with hash compaction |
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: 20170613 |
|
RJ01 | Rejection of invention patent application after publication |