CN109144872A - Detection method, device, terminal device and the readable storage medium storing program for executing of memory overflow - Google Patents

Detection method, device, terminal device and the readable storage medium storing program for executing of memory overflow Download PDF

Info

Publication number
CN109144872A
CN109144872A CN201810949637.3A CN201810949637A CN109144872A CN 109144872 A CN109144872 A CN 109144872A CN 201810949637 A CN201810949637 A CN 201810949637A CN 109144872 A CN109144872 A CN 109144872A
Authority
CN
China
Prior art keywords
memory
time
current
node
memory node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810949637.3A
Other languages
Chinese (zh)
Inventor
左虹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201810949637.3A priority Critical patent/CN109144872A/en
Publication of CN109144872A publication Critical patent/CN109144872A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics

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 application provides detection method, device, terminal device and the readable storage medium storing program for executing of a kind of memory overflow.Distribution uses the time byte space of time for recording memory in the memory head of each memory node that memory chained list is added, which comprises when reaching detection cycle, traverses the memory chained list;For each current memory node traversed, current memory is obtained from the time byte space of the current memory node and uses the time;Determine whether the current memory node occurs memory overflow using the time according to the current memory.Using the embodiment of the present application, it can be carried out the judgement of memory overflow by automatically recording current memory using the time, therefore reduce developer and manually write the triviality of memory release time operation, at the same avoid because memory release time choose it is improper caused by erroneous judgement to memory overflow.

Description

Detection method, device, terminal device and the readable storage medium storing program for executing of memory overflow
Technical field
This application involves field of computer technology, set more particularly to a kind of detection method of memory overflow, device, terminal Standby and readable storage medium storing program for executing.
Background technique
With increasingly complicated, effectively progress Memory Allocation, release and the inspection of computer applied algorithm design and development The problem of surveying memory overflow becomes more and more prominent.Memory overflow be in program oneself dynamically distribute heap memory for some reason It does not discharge or can not discharge, so that Installed System Memory be easy to cause to waste, it is serious that program operation speed slows down even system crash etc. Consequence.
It in the related technology, is usually to be write manually in application memory every time into memory head for the detection of memory overflow Enter a memory release time, if memory does not discharge, it is determined that detects memory overflow when reaching memory release time.
Above-mentioned technical proposal is due to needing to manually write memory release time, therefore increase in application memory every time The triviality of operation;And it if the memory release time filled in is less than actual memory release time, will cause to testing result Erroneous judgement.
Summary of the invention
The embodiment of the present application provides detection method, device, terminal device and the readable storage medium storing program for executing of a kind of memory overflow, with Solve the problem of that existing Memory leakage detection mode is cumbersome and testing result is be easy to cause to judge by accident.
Specifically, the embodiment of the present application is achieved by the following technical solution:
In a first aspect, a kind of detection method of memory overflow is provided, in each memory node that memory chained list is added Deposit the time byte space for distributing in head and using the time for recording memory, which comprises
When reaching detection cycle, the memory chained list is traversed;
For each current memory node traversed, obtains and work as from the time byte space of the current memory node Preceding memory uses the time;
Determine whether the current memory node occurs memory overflow using the time according to the current memory.
Second aspect, provides a kind of detection device of memory overflow, and described device includes:
Space distribution module, for distributing in the memory head of each memory node that memory chained list is added in recording Deposit the time byte space using the time;
Chained list spider module, for traversing the memory chained list when reaching detection cycle;
Time-obtaining module, for for each current memory node traversed, from the current memory node when Between obtain current memory in byte space and use the time;
Memory overflow determining module, for whether determining the current memory node using the time according to the current memory Memory overflow occurs.
The third aspect provides a kind of terminal device, comprising: internal bus, and by internal bus connect memory, Processor and external interface;Wherein,
The processor for reading the machine readable instructions on the memory, and executes described instruction to realize such as Lower operation:
Distribution uses the time of time for recording memory in the memory head of each memory node that memory chained list is added Byte space;
When reaching detection cycle, the memory chained list is traversed;
For each current memory node traversed, obtains and work as from the time byte space of the current memory node Preceding memory uses the time;
Determine whether the current memory node occurs memory overflow using the time according to the current memory.
Fourth aspect provides a kind of computer readable storage medium, comprising: is stored on the machine readable storage medium Several computer instructions, the computer instruction, which is performed, to be handled as follows:
Distribution uses the time of time for recording memory in the memory head of each memory node that memory chained list is added Byte space;
When reaching detection cycle, the memory chained list is traversed;
For each current memory node traversed, obtains and work as from the time byte space of the current memory node Preceding memory uses the time;
Determine whether the current memory node occurs memory overflow using the time according to the current memory.
As can be seen from the above technical solutions, in the embodiment of the present application, in the memory for the memory node that memory chained list is added It is assigned in head and uses the time byte space of time for recording memory, therefore traversing each memory on memory chained list When node, the last memory can be obtained automatically from the time byte space of the memory node using the time, and according to The memory judges whether the memory node occurs memory overflow using the time.Due to using the time can by automatically recording memory To carry out the judgement of memory overflow, therefore reduce the triviality that developer manually writes the operation of memory release time, simultaneously Avoid because memory release time choose it is improper caused by erroneous judgement to memory overflow.
Detailed description of the invention
Fig. 1 is the structural schematic diagram of the memory chained list in the detection embodiment of the application memory overflow;
Fig. 2 is one embodiment flow chart of the detection method of the application memory overflow;
Fig. 3 is another embodiment flow chart of the detection method of the application memory overflow;
Fig. 4 is one embodiment block diagram of the detection device of the application memory overflow;
Fig. 5 is a kind of hardware structure diagram of the application terminal device.
Specific embodiment
It is right in the following with reference to the drawings and specific embodiments in order to keep the purposes, technical schemes and advantages of the application clearer The application is described in detail.
Memory is one of the ost important components in terminal device, such as PC, in PC all programs be all after being called by CPU It is run in memory, therefore influence of the performance of memory to terminal device is very big.The mode of any program normal use memory is all It is that, using being discharged after terminating, if do not discharged, will appear memory overflow using preceding first to file, causes subsequent in this Depositing can not all be used.Therefore it after multiple program application memories, if these memories are not discharged in time, may lead It causes memory to exhaust, can not work normally so as to cause terminal device.
The memory being applied inside usual terminal device by memory linked list maintenance, memory chained list is a kind of physical store Discontinuous on unit, non-sequential storage organization, every section of memory being applied corresponds to a memory node on memory chained list, interior Depositing the logical order between node is realized by the pointer link orders in chained list.
The type of chained list may include: single-track link table, doubly linked list and circular linked list.Wherein, each of doubly linked list All there are two pointers in memory node, are respectively directed to the descendant node and predecessor node of the memory node.Therefore from doubly linked list In any one memory node start, can easily access its predecessor node and descendant node.The application is implemented Example is described by taking doubly linked list as an example, and the structure of doubly linked list is as shown in Figure 1.
As shown in Figure 1, doubly linked list may include: linked list head, and one or more memory nodes, wherein linked list head packet Include: Head (head pointer) and Count (function), Head can be directed toward first memory node;Each memory node may include Memory head and data space;Further, the memory head in the embodiment of the present application may include: position byte space, time word Save space, pointer space etc..Wherein, position byte space can store: function name, filename, the information such as line number, time byte Space can store the time that uses of current memory, and pointer space is for storing predecessor pointers prev and heir pointer next, institute Stating predecessor pointers prev can be used for being directed toward previous memory node, and heir pointer next can be used for being directed toward the latter memory section Point.The memory of application will be applied using the predecessor pointers prev and heir pointer next in linked list head and memory node Memory be together in series, constitute memory chained list.
In the embodiment of the present application, the time byte of null of time is used for recording memory due to being assigned in memory head Between, therefore when traversing memory chained list, the last time can be obtained automatically from the time byte space of each memory node Memory uses the time, to judge whether the memory node occurs memory overflow using the time according to the memory.With the relevant technologies In manually write the memory overflow time and compare, due to can be carried out sentencing for memory overflow using the time by automatically recording memory It is disconnected, therefore reduce the cumbersome property of developer, at the same can to avoid because memory release time choose it is improper caused by internally The erroneous judgement for depositing leakage promotes the accuracy of Memory leakage detection.
It referring to fig. 2, is one embodiment flow chart of the detection method of the application memory overflow, which may include Following steps:
Step 201, when reaching detection cycle, memory chained list is traversed;
In the present embodiment, memory overflow can be detected according to preset detection cycle, which can be The detection cycle for a routine being manually set.Such as: by taking detection cycle is 1 minute as an example, then every 1 minute, begin stepping through Memory chained list.Due to containing continuous memory node in logic on memory chained list, traversal memory chained list will be to memory node It is detected one by one.
Step 202, it for each current memory node traversed, is obtained from the time byte space of current memory node Current memory is taken to use the time;
When traversing memory chained list, currently traverse memory node is known as current memory node, in conjunction with aforementioned Fig. 1 description it is found that due to being assigned with position byte space and time byte space in the memory of each memory node, time When going through to the current memory node, the current memory nearest one can be obtained from the time byte space of the current memory node The secondary time used, the time are properly termed as current memory and use the time.
Step 203, determine whether current memory node occurs memory overflow using the time according to current memory.
In an optional implementation, when carrying out memory overflow judgement, current sensing time can be obtained, that is, is worked as Then preceding system time calculates the time difference that the current memory that gets uses time and the current sensing time, this when Between difference indicate the duration that is not used by of current memory node.Gained time difference is compared with preset time threshold, When the time difference is greater than the preset time threshold, determines that memory overflow occurs for the current memory node, will let out The memory of leakage discharges, and deletes from memory chained list;When the time difference is less than the preset time threshold, institute is determined It states current memory node and memory overflow does not occur, the memory not leaked is also deleted on traversal chained list, subsequent detection will no longer The memory being once released before detection.
In an optional example, above-mentioned preset time threshold can according to the actual conditions of memory frequency of use into The corresponding setting of row.Memory higher for frequency of use time threshold can be arranged less than normal;For frequency of use Lower memory time threshold can be arranged bigger than normal.Such as: the memory of high-frequency log class, almost every two or three The time of even several seconds minute just will use once, therefore can set the time threshold of this kind of memory to 3 minutes;It is low The memory of frequency usage will not all be used every even hour half an hour sometimes, therefore can be by this kind of memory Time threshold be set as 2 hours.It should be noted that the frequency of use in this example it is higher and it is lower only in contrast, Exemplifications set out does not limit actual classification and setting.Correspondingly, being different types of according to frequency of use It, can be with after traverse current memory node and get the time difference of the memory node after memory setting time threshold Its corresponding time threshold is obtained according to the type of current memory, then compares time difference and time threshold.
By above embodiments as it can be seen that the embodiment is assigned with use in the memory head of memory node that memory chained list is added The time byte space of time is used in record memory, it, can be with therefore when traversing each memory node on memory chained list When obtaining the last memory automatically from the time byte space of the memory node using the time, and being used according to the memory Between judge whether the memory node occurs memory overflow.It is let out due to can be carried out memory using the time by automatically recording memory The judgement of leakage, therefore reduce developer and manually write the triviality of memory release time operation, while avoiding because of memory Release time chooses the improper erroneous judgement caused to memory overflow.
It is another embodiment flow chart of the detection method of the application memory overflow, the embodiment is to memory referring to Fig. 3 Leak detection and testing result output are described in detail, which may include steps of:
Step 301, when there is memory node that memory chained list is added, time byte of null is distributed in the memory head of memory node Between and position byte space;
In conjunction with Fig. 1 it is found that when there is new memory application every time, new memory section can accordingly be added in memory chained list Point, and corresponding memory head and data space are distributed for the memory node, time byte space is further distributed in memory head With position byte space.Wherein, time byte space is for storing current memory using the time, and position byte space is for storing The information such as function name, document number and line number.
In the present embodiment, memory head can be on the head of memory node space, can also be in the tail of memory node space Portion is not limited this present embodiment, as long as adjacent memory node can be associated to one-to-one correspondence.
Step 302, when having memory node by use, the time byte for calling preset macro function to calculate the memory node The address in space;
If some current memory node on memory chained list is used, pass through current memory node using macro function The address of the address calculation storage time byte space of position byte space.In conjunction with Fig. 1, specific calculation method can be basis The address (address of data) of current memory node location byte space, by one section of memory of address offset of its position byte space The size in space, offset memory space can subtract and work as according to memory node storage time byte space address (address of time) The address (address of first byte in data) that first byte uses in the byte space of preceding memory node position.
Step 303, the corresponding current memory of the memory node is used into write time time byte space according to address;
The corresponding current memory of current memory node is used into the time, write-in step is automatically updated by the function of macro function In the rapid 302 time byte space addresses being calculated.
Step 304, when reaching detection cycle, memory chained list is traversed;
Step 305, it for each current memory node traversed, is obtained from the time byte space of current memory node Current memory is taken to use the time;
Step 306, determine whether current memory node occurs memory overflow using the time according to current memory;
The step 201 into step 306 and Fig. 2 embodiment of abovementioned steps 304 is consistent to step 203, and details are not described herein.
Step 307, when determining that memory overflow occurs for current memory node, the location information of current memory node is exported.
In an optional implementation, when determining that current memory node leaks, the institute leaked will test out State the core position information of current memory location information or the current memory node and not making for the current memory node With duration, developer is fed back to, so that developer quickly determines according to the location information of memory overflow the position of memory overflow It sets.Wherein, the core position information includes at least following a kind of information: the function name of current memory node memory storage, row Number, the relevant informations such as filename.
By above embodiments as it can be seen that the embodiment is assigned with the time for using the time for recording memory in memory head Byte space, therefore when traversing memory chained list, it can be obtained automatically from the time byte space of each memory node nearest Primary memory uses the time, to judge whether the memory node occurs memory overflow using the time according to the memory.Due to It can be carried out the judgement of memory overflow by automatically recording memory using the time, therefore reduce the cumbersome of developer Property, at the same can to avoid because memory release time choose it is improper caused by erroneous judgement to memory overflow, promote Memory leakage detection Accuracy.
The Memory leakage detection process of the embodiment of the present application is described in detail below by an application example.
Assuming that the memory headroom for thering is some program to need to apply 10 bytes, for storing character string abcdefghi.Then should For program when applying for memory headroom, system can distribute the memory headroom of 70 bytes for the program, and will add as memory node It is added in memory chained list, wherein memory node includes the memory head of 60 bytes and the data space of 10 bytes.
In the memory head of 60 bytes, it is assumed that the byte of front 20 is used to store the function name of caller;21-30 A byte is used to store the line number of caller;31-44 byte is used to the time byte of null of stored memory currently used time Between, such as: 00 divides 00 second at 2018 08 month 15 days 15;The 45-52 byte is used to store predecessor pointers prev, and 53-60 is a Byte is used to store heir pointer next.In the data space of 10 bytes, i.e., the 60-70 byte is used to store character string abcdefghi。
When 70 bytes memory headroom by use, using macro function function, by the 60-70 byte of memory storage word Address of the address of symbol string abcdefghi as input parameter, is used to by calling the macro function that 31-44 byte is calculated The address of the currently used time byte space of stored memory.Specific calculation method is the ground that will store character string abcdefghi Location deviates one section of memory headroom, and the size of the memory headroom of offset is the time byte space address of memory currently used time (00 divides 00 second storage address at 2018 08 month 15 days 15) subtracts the byte of initial a in storage character string abcdefghi Space address, it may be assumed that 30 bytes of biased forwards obtain the currently used time location of memory at the position of initial a byte.Often Secondary that macro function is all called before using the memory, newest by current memory uses write time time byte space, The newest use time i.e. current memory for automatically recording the memory node uses the time (assuming that the newest use time is 2018 10 divide 00 second at 08 month 15 days 15).
Assuming that the time cycle of Memory leakage detection is 5 minutes, then 5 points after distance last Memory leakage detection Clock traverses memory chained list.When traversing above-mentioned memory node, when can obtain the newest use of the memory headroom of 70 bytes Between 10 divide 00 second (the i.e. described memory currently used time divided by 2018 08 month 15 days 15 00 when being 2018 08 month 15 days 15 10 divide 00 second when being updated within 00 second 2018 08 month 15 days 15).
Newest by the memory headroom of 70 bytes divides 00 second and current inspection using at the time 2018 08 month 15 days 15 10 20 divide 00 second and are compared when surveying the time 2018 08 month 15 days 15, if the newest difference using time and current sensing time is big In preset time threshold 5 minutes, then it is assumed that the memory headroom of 70 bytes is leaked, and the memory of leakage is discharged, and from It is deleted on memory chained list;If newest be less than preset time threshold 5 minutes using the time difference of time and current sensing time, Think that the memory headroom of 70 bytes does not leak, the memory not leaked is also deleted on traversal chained list, subsequent detection will The memory being no longer once released before detection.
If it is determined that memory overflow has occurred in the memory headroom of current 70 bytes, then exporting determining for the current memory Position information;Wherein, the location information of signified output can be the location information or storage word of storage character string abcdefghi Duration is not used in the memory headroom of the location information and 70 bytes that accord with string.
Corresponding with the embodiment of the detection method of aforementioned memory overflow, present invention also provides a kind of inspections of memory overflow Survey the embodiment of device.It referring to figure 4., is one embodiment block diagram of the detection device of the application memory overflow, described device It include: space distribution module 401, chained list spider module 402, time-obtaining module 403, memory overflow determining module 404.
Wherein, space distribution module 401 is used for distributing in the memory head of each memory node that memory chained list is added The time byte space of time is used in record memory;
Chained list spider module 402, for traversing memory chained list when reaching detection cycle;
Time-obtaining module 403, for for each current memory node traversed, from the time of current memory node Current memory is obtained in byte space uses the time;
Memory overflow determining module 404, for determining whether current memory node occurs using the time according to current memory Memory overflow.
In an optional example, described device can also include (being not shown in Fig. 4): address calculation module, time Memory module.
Address calculation module, for when the current memory node is by use, call described in preset macro function calculating The address of time byte space;
Time memory module, for the time byte of null to be written using the time in the current memory according to the address Between.
In another optional example, memory overflow determining module 404 may include (being not shown in Fig. 4): time difference It is worth module, time comparison module, memory overflow module.
Time difference module uses the time difference of time and current sensing time, institute for calculating the current memory Time difference is stated for indicating the duration that the current memory node is not used by;
Time comparison module, for the time difference and preset time threshold;
Memory overflow module, for determining the current memory section when the time difference is greater than the time threshold Memory overflow occurs for point.
In another optional example, described device can also include (being not shown in Fig. 4): message output module.
The space distribution module 401 is also used to distribute in the memory head of each memory node for recording memory bits The position byte space of confidence breath;Wherein, the core position information includes at least one following information: function name, filename And line number;
Message output module, for exporting the current memory when determining that memory overflow occurs for the preceding memory node Node locating information;
Wherein, the location information includes:
The core position information of the current memory node;Alternatively,
The unused duration of the core position information of the current memory node and the current memory node.
By above embodiments as it can be seen that the embodiment distributes time byte space and position word in the memory head of memory node Space is saved, the corresponding current memory of the memory node is used into write time time byte space using macro function, passes through week The traversal memory chained list of phase property, traversal obtain the use of corresponding current memory in the time byte space of current memory node Time uses the duration of time gap detection time, according to current memory so that developer fast and accurately determines whether to send out Raw memory overflow.The embodiment is solved the problems, such as because manual operation bring is cumbersome, while also improving whether memory leaks inspection Survey the accuracy of result.
Corresponding with the embodiment of the detection method of aforementioned memory overflow, present invention also provides a kind of realities of terminal device Apply example.
It referring to figure 5., is a hardware structure diagram of the application terminal device.The terminal device includes: internal bus 501, and the memory 502 connected by internal bus, processor 503 and external interface 504;Wherein,
The processor 503 for reading the machine readable instructions on the memory, and executes described instruction to realize Following operation:
Distribution uses the time of time for recording memory in the memory head of each memory node that memory chained list is added Byte space;
When reaching detection cycle, the memory chained list is traversed;
For each current memory node traversed, obtains and work as from the time byte space of the current memory node Preceding memory uses the time;
Determine whether the current memory node occurs memory overflow using the time according to the current memory.
It is corresponding with the embodiment of the detection method of aforementioned memory overflow, it computer-readable is deposited present invention also provides a kind of Storage media, comprising: several computer instructions are stored on the machine readable storage medium, the computer instruction is performed It is handled as follows:
Distribution uses the time of time for recording memory in the memory head of each memory node that memory chained list is added Byte space;
When reaching detection cycle, the memory chained list is traversed;
For each current memory node traversed, obtains and work as from the time byte space of the current memory node Preceding memory uses the time;
Determine whether the current memory node occurs memory overflow using the time according to the current memory.
Above-mentioned apparatus, terminal device, the function of modules and the realization process of effect tool in computer-readable medium Body is detailed in the realization process that step is corresponded in the above method, and details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality Apply the part explanation of example.Installation practice described above, terminal device embodiment, computer readable storage medium are real It is only schematical to apply example, wherein the unit as illustrated by the separation member may or may not be and physically divide It opens, component shown as a unit may or may not be physical unit, it can in one place, Huo Zheye It can be distributed over a plurality of network elements.It can select some or all of the modules therein according to the actual needs to realize this The purpose of application scheme.Those of ordinary skill in the art can understand and implement without creative efforts.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the application Its embodiment.This application is intended to cover any variations, uses, or adaptations of the application, these modifications, purposes or Person's adaptive change follows the general principle of the application and including the undocumented common knowledge in the art of the application Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the application are by following Claim is pointed out.
The foregoing is merely the preferred embodiments of the application, not to limit the application, all essences in the application Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the application protection.

Claims (10)

1. a kind of detection method of memory overflow, which is characterized in that in the memory head for each memory node that memory chained list is added Middle distribution uses the time byte space of time for recording memory, which comprises
When reaching detection cycle, the memory chained list is traversed;
For each current memory node traversed, obtained in current from the time byte space of the current memory node It deposits and uses the time;
Determine whether the current memory node occurs memory overflow using the time according to the current memory.
2. the method according to claim 1, wherein this method further include:
When the current memory node is by use, the preset macro function of calling calculates the address of the time byte space;
The time byte space is written into using the time in the current memory according to the address.
3. the method according to claim 1, wherein being determined according to the current memory using the time described current Whether memory node occurs memory overflow, comprising:
The time difference that the current memory uses time and current sensing time is calculated, the time difference is for indicating described The duration that current memory node is not used by;
Compare the time difference and preset time threshold;
When the time difference is greater than the time threshold, determine that memory overflow occurs for the current memory node.
4. according to claim 1 to method described in 3, which is characterized in that this method further include:
The position byte space for recording core position information is distributed in the memory head of each memory node;
Wherein, the core position information includes at least one following information: function name, filename and line number.
5. according to the method described in claim 4, it is characterized in that, this method further include:
When determining that memory overflow occurs for the current memory node, the current memory node locating information is exported;
The location information includes:
The core position information of the current memory node;Alternatively,
The unused duration of the core position information of the current memory node and the current memory node.
6. a kind of detection device of memory overflow, which is characterized in that described device includes:
Space distribution module makes for distributing in the memory head of each memory node that memory chained list is added for recording memory With the time byte space of time;
Chained list spider module, for traversing the memory chained list when reaching detection cycle;
Time-obtaining module, for for each current memory node traversed, from the time word of the current memory node It saves acquisition current memory in space and uses the time;
Memory overflow determining module, for determining whether the current memory node occurs using the time according to the current memory Memory overflow.
7. device according to claim 6, which is characterized in that further include:
Address calculation module, for when the current memory node is by use, call preset macro function to calculate the time The address of byte space;
Time memory module, for the time byte space to be written using the time in the current memory according to the address.
8. device according to claim 6, which is characterized in that
The space distribution module is also used to distribute in the memory head of each memory node for recording core position information Position byte space;Wherein, the core position information includes at least one following information: function name, filename and line number;
Described device further include:
Message output module, for exporting the current memory section when determining that memory overflow occurs for the current memory node The location information of point;
Wherein, the location information includes:
The core position information of the current memory node;Alternatively,
The unused duration of the core position information of the current memory node and the current memory node.
9. a kind of terminal device characterized by comprising internal bus, and the memory by internal bus connection, processing Device and external interface;Wherein,
The processor for reading the machine readable instructions on the memory, and executes described instruction to realize following behaviour Make:
Distribution uses the time byte of time for recording memory in the memory head of each memory node that memory chained list is added Space;
When reaching detection cycle, the memory chained list is traversed;
For each current memory node traversed, obtained in current from the time byte space of the current memory node It deposits and uses the time;
Determine whether the current memory node occurs memory overflow using the time according to the current memory.
10. a kind of computer readable storage medium characterized by comprising if being stored on the machine readable storage medium Dry computer instruction, the computer instruction, which is performed, to be handled as follows:
Distribution uses the time byte of time for recording memory in the memory head of each memory node that memory chained list is added Space;
When reaching detection cycle, the memory chained list is traversed;
For each current memory node traversed, obtained in current from the time byte space of the current memory node It deposits and uses the time;
Determine whether the current memory node occurs memory overflow using the time according to the current memory.
CN201810949637.3A 2018-08-20 2018-08-20 Detection method, device, terminal device and the readable storage medium storing program for executing of memory overflow Pending CN109144872A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810949637.3A CN109144872A (en) 2018-08-20 2018-08-20 Detection method, device, terminal device and the readable storage medium storing program for executing of memory overflow

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810949637.3A CN109144872A (en) 2018-08-20 2018-08-20 Detection method, device, terminal device and the readable storage medium storing program for executing of memory overflow

Publications (1)

Publication Number Publication Date
CN109144872A true CN109144872A (en) 2019-01-04

Family

ID=64790628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810949637.3A Pending CN109144872A (en) 2018-08-20 2018-08-20 Detection method, device, terminal device and the readable storage medium storing program for executing of memory overflow

Country Status (1)

Country Link
CN (1) CN109144872A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457150A (en) * 2019-07-10 2019-11-15 锐捷网络股份有限公司 A kind of memory failure detection method and device
CN110727585A (en) * 2019-09-11 2020-01-24 锐捷网络股份有限公司 Memory leak detection method and device, electronic equipment and readable storage medium
CN111352829A (en) * 2019-11-21 2020-06-30 杭州迪普科技股份有限公司 Memory leak test method, device and equipment
CN112463632A (en) * 2020-12-11 2021-03-09 苏州浪潮智能科技有限公司 Memory leak detection method and device
CN112732640A (en) * 2020-12-28 2021-04-30 杭州迪普科技股份有限公司 Method and device for detecting file descriptor leakage
CN112817838A (en) * 2019-11-18 2021-05-18 迈普通信技术股份有限公司 Memory leak information processing method and device, electronic equipment and storage medium
CN113377522A (en) * 2020-03-09 2021-09-10 大唐移动通信设备有限公司 Method and device for processing memory blocks in memory pool, electronic equipment and storage medium
WO2022218057A1 (en) * 2021-04-14 2022-10-20 北京字节跳动网络技术有限公司 Memory leak attribution method and apparatus, and electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1845080A (en) * 2005-04-07 2006-10-11 华为技术有限公司 Memory leakage detection and prevention method
CN101145128A (en) * 2007-06-13 2008-03-19 中兴通讯股份有限公司 Method for detecting RAM leakage
CN101162436A (en) * 2006-10-13 2008-04-16 中兴通讯股份有限公司 Ems memory leakage testing method in communication apparatus system
CN104572460A (en) * 2014-12-30 2015-04-29 大唐移动通信设备有限公司 Memory leak detecting method and memory leak detecting device
US20170308449A1 (en) * 2016-04-26 2017-10-26 Servicenow, Inc. Detection and Remediation of Memory Leaks
CN108334435A (en) * 2018-01-18 2018-07-27 杭州迪普科技股份有限公司 A kind of based reminding method and device of shared drive leakage

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1845080A (en) * 2005-04-07 2006-10-11 华为技术有限公司 Memory leakage detection and prevention method
CN101162436A (en) * 2006-10-13 2008-04-16 中兴通讯股份有限公司 Ems memory leakage testing method in communication apparatus system
CN101145128A (en) * 2007-06-13 2008-03-19 中兴通讯股份有限公司 Method for detecting RAM leakage
CN104572460A (en) * 2014-12-30 2015-04-29 大唐移动通信设备有限公司 Memory leak detecting method and memory leak detecting device
US20170308449A1 (en) * 2016-04-26 2017-10-26 Servicenow, Inc. Detection and Remediation of Memory Leaks
CN108334435A (en) * 2018-01-18 2018-07-27 杭州迪普科技股份有限公司 A kind of based reminding method and device of shared drive leakage

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457150A (en) * 2019-07-10 2019-11-15 锐捷网络股份有限公司 A kind of memory failure detection method and device
CN110457150B (en) * 2019-07-10 2023-03-21 锐捷网络股份有限公司 Memory fault detection method and device
CN110727585A (en) * 2019-09-11 2020-01-24 锐捷网络股份有限公司 Memory leak detection method and device, electronic equipment and readable storage medium
CN110727585B (en) * 2019-09-11 2023-07-21 锐捷网络股份有限公司 Memory leak detection method, device, electronic equipment and readable storage medium
CN112817838A (en) * 2019-11-18 2021-05-18 迈普通信技术股份有限公司 Memory leak information processing method and device, electronic equipment and storage medium
CN111352829A (en) * 2019-11-21 2020-06-30 杭州迪普科技股份有限公司 Memory leak test method, device and equipment
CN113377522A (en) * 2020-03-09 2021-09-10 大唐移动通信设备有限公司 Method and device for processing memory blocks in memory pool, electronic equipment and storage medium
CN113377522B (en) * 2020-03-09 2024-06-21 大唐移动通信设备有限公司 Method and device for processing memory blocks in memory pool, electronic equipment and storage medium
CN112463632A (en) * 2020-12-11 2021-03-09 苏州浪潮智能科技有限公司 Memory leak detection method and device
CN112463632B (en) * 2020-12-11 2022-06-07 苏州浪潮智能科技有限公司 Memory leak detection method and device
CN112732640A (en) * 2020-12-28 2021-04-30 杭州迪普科技股份有限公司 Method and device for detecting file descriptor leakage
WO2022218057A1 (en) * 2021-04-14 2022-10-20 北京字节跳动网络技术有限公司 Memory leak attribution method and apparatus, and electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN109144872A (en) Detection method, device, terminal device and the readable storage medium storing program for executing of memory overflow
US9529692B2 (en) Memory management tools
CN107066390B (en) Dynamic memory leak detection method and system
US7530056B1 (en) Method and system for detecting runtime defects in a program by comparing correct and incorrect runs
CN110413521B (en) Write-crossing detection method and device for heap memory
CN106569904A (en) Information storage method and device and server
US10241895B2 (en) Memory stack trace management tool
CN109213641A (en) Buffer consistency detection system and method
CN105183641B (en) The data consistency verification method and system of a kind of kernel module
CN113836184A (en) Service persistence method and device
CN105183542A (en) Memory management method and system
CN109542444A (en) Monitoring method, device, server and the storage medium of JAVA application
CN114461341A (en) Method, device and medium for preventing brain crack of cloud platform virtual machine
US9329972B2 (en) Implementing client based throttled error logging in a computing device
US20070150866A1 (en) Displaying parameters associated with call statements
CN113315750A (en) Kafka message issuing method, device and storage medium
Seiter et al. Determining relevant model elements for the verification of UML/OCL specifications
CN104519516B (en) The method and device that memory is tested
CN106202374A (en) A kind of data processing method and device
GB2551574A (en) An apparatus and method for generating and processing a trace stream indicative of instruction execution by processing circuitry
US10496524B2 (en) Separating test coverage in software processes using shared memory
CN111858307B (en) Fuzzy test method and equipment
EP3721346B1 (en) Bit-accurate-tracing analysis with applied memory region lifetimes
CN109086205A (en) The EMS memory error adjustment method and device in pond based on memory
CN106326094A (en) Method and system for inspecting abnormity of pointer

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

Application publication date: 20190104