CN104182320A - Method and device for monitoring leakage of memory - Google Patents

Method and device for monitoring leakage of memory Download PDF

Info

Publication number
CN104182320A
CN104182320A CN201310195512.3A CN201310195512A CN104182320A CN 104182320 A CN104182320 A CN 104182320A CN 201310195512 A CN201310195512 A CN 201310195512A CN 104182320 A CN104182320 A CN 104182320A
Authority
CN
China
Prior art keywords
memory
information
user interface
operating user
interface information
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.)
Granted
Application number
CN201310195512.3A
Other languages
Chinese (zh)
Other versions
CN104182320B (en
Inventor
李彬
罗静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201310195512.3A priority Critical patent/CN104182320B/en
Publication of CN104182320A publication Critical patent/CN104182320A/en
Application granted granted Critical
Publication of CN104182320B publication Critical patent/CN104182320B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for monitoring leakage of a memory. The method comprises the following steps of monitoring the operation information of a user interface of a user on an application program, and storing the monitored operation information of the user interface; monitoring the usage condition of the memory of a system, and obtaining the information of the memory of the system; obtaining the key field value for indicating the usage condition of the memory in the application program from the information of the memory; if the first comparison result indicates that the key field value is greater than the first preset threshold, determining the occurrence of leakage of the memory, and utilizing the operation information of the user interface and the information of the memory to generate alarming information; after receiving triggering information, outputting the alarming information. The method and the device have the advantage that the particular operation scene which occurs during the leakage of the memory can be determined, and the corresponding LOG information is analyzed, so a developer can quickly locate the use problem of the memory in the program.

Description

A kind of method and device of monitoring memory overflow
Technical field
The present invention relates to electronic technology field, relate in particular to a kind of method and device of monitoring memory overflow.
Background technology
In prior art, use JAVA language in Android system during developing application, if improper use, be easy to occur memory overflow, in computer science, memory overflow (memory leak) refers to due to carelessness or the wrong situation that causes program to fail to discharge the internal memory not re-used.Memory overflow not refers to internal memory disappearance physically, but after application assigned section internal memory, due to design mistake, has lost the control to this section of internal memory, thereby has caused the waste of internal memory.Memory overflow has similar symptom to many other problemses, and the programmer that generally can only can obtain program source code by those just can analyze out.Yet the increase that has many people to get used to any unwanted internal memory to use is described as memory overflow, on stricti jurise, this is inaccurate.
The memory overflow of general normal theory refers to the leakage of heap memory.Heap memory refers to what program was distributed from heap, and size is (size of memory block can determine in the program runtime) arbitrarily, the internal memory of necessary explicit release after using.Application program is generally used malloc, calloc, the functions such as realloc (using new operational character in C++) are assigned to an internal memory from heap, after using, program must be responsible for calling accordingly free or delete discharges this memory block, otherwise this piece internal memory just can not be used again, this has just said this piece memory overflow.
The JVM of Android system provides garbage collector (Garbage Collection, the GC) recovery of managing internal memory automatically, and programmer does not need to carry out releasing memory by call function.Therefore, a lot of programmers think that Java does not exist memory leak issue, even or think there is the responsibility that memory overflow neither program, but the problem of GC or JVM.In fact, this idea is incorrect, because Java also exists memory overflow, but its performance is different from C++.If the Java code of developing wants whole day to move on server for 24 hours, Memory Leaks impact is herein just much bigger than the impact in configuration utility, even if minimum leak also can cause JVM to exhaust whole free memories.In addition, in a lot of embedded systems, the total amount of internal memory is very limited.Contrary in the situation that, even if the life cycle of program is shorter, if exist to distribute any Java code of a large amount of temporary objects (or some objects of engulfing a large amount of internal memories), and when no longer needing these objects, do not cancel they quote yet, still may reach the internal memory limit.
Although JVM provides GC mechanism can to a certain degree prevent RAM leakage, but can not avoid completely, once leak, can cause application to stop, even system crash.
For still there being the problem of RAM leakage under GC mechanism in prior art, the existing solution providing is: the DDMS (Dalvik Debug Monitor Service is the Dalvik virtual machine debugging monitor service in Android development environment) or the MAT memory analysis instrument that use android to provide.But this scheme still exist some shortcomings as: must line debugging, using PC to connect monitoring mobile phone internal memory changes, and memory overflow may occur under the operation of some special scenes, such as the situation of freely testing, therefore cannot catch the situation of these specific operations during line, miss the scene of finding memory leak issue.
In addition, DDMS relates to more professional operating process, thus need to there is very strong specialized technical knowledge ability flexible Application, so cause operation inconvenience.
Summary of the invention
The invention provides a kind of method and device of monitoring memory overflow, method and apparatus provided by the present invention solves memory leak detecting in prior art cannot determine the specific operation situation while there is Memory Leaks, misses the problem of the scene of finding memory leak issue.
For the problems referred to above, the invention provides a kind of method of monitoring memory overflow, the method is applied in an electronic equipment, and the method comprises:
Monitor user ' is for the operating user interface information of an application program, and the operating user interface information that monitors of storage;
Supervisory system internal memory service condition, obtains the memory information of system;
From described memory information, obtain the primary key value that indicates a described application program internal memory service condition, and described primary key value and the first predetermined threshold value are compared, obtain the first comparative result;
If described the first comparative result is described primary key value, be greater than described the first predetermined threshold value, determine RAM leakage has occurred, utilize described operating user interface information and described memory information to generate a warning message;
Receive after a trigger message, export described warning message.
The scheme of more optimizing, the operating user interface information that storage monitors comprises:
Detect the operating user interface number of times of having stored and whether surpass Second Threshold, if so, utilize and newly monitor the operating user interface information that the covering of operating user interface information has been stored.
The scheme of more optimizing, utilize newly to monitor the operating user interface information that operating user interface information covers to store and comprise:
Determine the corresponding storage time of each operating user interface information of having stored;
Utilize the operating user interface information updating newly monitoring apart from the corresponding operating user interface information of current time operating user interface farthest.
The scheme of more optimizing, described operating user interface information comprises the character string information that operational controls action message, user input in dialog box.
The scheme of more optimizing, when the system in described electronic equipment is Android system or linux system, described supervisory system internal memory service condition, the memory information that obtains system comprises:
The physical memory that the process of the application program detecting is taken alone, supervisory system used internal memory situation or free memory situation information, detect memory information corresponding record that the machine heap memory and dalvik use in default field value.
For said method the present invention, also provide a kind of device of monitoring memory overflow, this application of installation is in an electronic equipment, and this device comprises:
Operation information acquisition module, the operating user interface information for monitor user ' for an application program, and store the operating user interface information monitoring;
Memory information detection module, for supervisory system internal memory service condition, obtains the memory information of system;
The first comparison module, for obtain the primary key value that indicates a described application program internal memory service condition from described memory information, and compares described primary key value and the first predetermined threshold value, obtains the first comparative result;
Warning message generation module, is greater than described the first predetermined threshold value if described the first comparative result is described primary key value, for determining, RAM leakage has occurred, and utilizes described operating user interface information and described memory information to generate a warning message;
Message output module, for receiving after a trigger message, exports described warning message.
The scheme of more optimizing, whether described operation information acquisition module also surpasses Second Threshold for detection of the operating user interface number of times of having stored, and if so, utilizes and newly monitors the operating user interface information that the covering of operating user interface information has been stored.
The scheme of more optimizing, described operation information acquisition module is also for determining the corresponding storage time of each operating user interface information of having stored; Utilize the operating user interface information updating newly monitoring apart from the corresponding operating user interface information of current time operating user interface farthest.
The scheme of more optimizing, this device comprises modular converter, before the operating user interface information monitoring in storage, for the operating user interface information detecting is converted to default script.
The scheme of more optimizing, when the system in described electronic equipment is Android system or linux system, memory information detection module has also been used internal memory situation or free memory situation information, has detected memory information corresponding record that the machine heap memory and dalvik use to default field value for physical memory, supervisory system that the process of the application program detecting is taken alone.
One or two in technique scheme, at least has following technique effect:
The method and apparatus that the embodiment of the present invention provides, the operation information while first having monitored user to the user interface executable operations of an application program, and the service condition of supervisory system internal memory simultaneously; When monitoring Installed System Memory, use appearance abnormal, can be by memory abnormal situation and user's operation information in conjunction with generating corresponding warning.If in the time of by said method subsequent detection personnel detection system problem, can directly transfer the warning message of having stored and analyze for testing staff.Thereby the off-line of having realized memory leak detecting is used, and can, in the application development debug phase, by tester, carry out free test, pressure test etc.;
Because preserved corresponding user's operation information when finding Installed System Memory problem, so testing staff can determine the special scenes that equipment goes wrong when detected electrons equipment failure.When detecting while there is memory leak issue, can contrast specific operation scene, analyze corresponding LOG information, be convenient to the problem that in the quick finder of developer, internal memory is used.And method step provided by the invention is easy, without tester, grasp the using method of the professional tools such as DDMS.
Accompanying drawing explanation
Fig. 1 is a kind of process flow diagram of monitoring the method for memory overflow of the embodiment of the present invention;
Fig. 2 is a kind of structural representation of monitoring the device of memory overflow of the embodiment of the present invention.
Embodiment
For still there being the problem of RAM leakage under GC mechanism in prior art, the existing solution providing is: the DDMS (Dalvik Debug Monitor Service is the Dalvik virtual machine debugging monitor service in Android development environment) or the MAT memory analysis instrument that use android to provide.But this scheme still exist some shortcomings as: must line debugging, using PC to connect monitoring mobile phone internal memory changes, and memory overflow may occur under the operation of some special scenes, such as the situation of freely testing, therefore cannot catch the situation of these specific operations during line, miss the scene of finding memory leak issue.In addition, DDMS relates to more professional operating process, thus need to there is very strong specialized technical knowledge ability flexible Application, so cause operation inconvenience.
The key that detects memory overflow is to want to intercept and capture calling the function of storage allocation and releasing memory.Intercept and capture this two functions, the life cycle that just can follow the tracks of each piece internal memory, such as, after internal memory of successful distribution, just its pointer is added in an overall list; Whenever discharging an internal memory, then its pointer is deleted from list.Like this, in the time of EOP (end of program), in list, remaining pointer points to those does not exactly have d/d internal memory.
If detect the leakage of heap memory, need so to intercept and capture malloc/rea11oc/free and new/delete with regard to passable (new/delete is also finally with malloc/free, so as long as intercept and capture one group above in fact).For other leakage, can adopt similar method, intercept and capture corresponding distribution and release function.Such as, detect the leakage of BSTR, just need to intercept and capture SysAllocString/SysFreeString; Detect the leakage of HMENU, just need to intercept and capture CreateMenu/DestroyMenu.(partition function of the resource having has a plurality of, discharges function and only has one, such as, SysAllocStringLen also can be used for distributing BSTR, at this moment just need to intercept and capture a plurality of partition functions)
Under windows platform, what the instrument of detection memory overflow was conventional generally has three kinds, the measuring ability that MS C-Runtime Library is built-in; The testing tool of external hanging type, such as, Purify, BoundsChecker etc.; The Performance Monitor that utilizes Windows NT to carry.These three kinds of instruments respectively have relative merits, although a little less than wanting than the instrument of external hanging type in MS C-Runt ime Library function, it is free; Although Performance Monitor cannot indicate the code of generation problem, it can detect the existence of the memory overflow of implicit expression, and this is other helpless places of two classes instrument.
The origin cause of formation and feature for above-mentioned the problems of the prior art and RAM leakage, the invention provides a kind of method of monitoring memory overflow, the method is applied in an electronic equipment, the method comprises: monitor user ' is for the operating user interface information of an application program, and the operating user interface information that monitors of storage; Supervisory system internal memory service condition, obtains the memory information of system; From described memory information, obtain the primary key value that indicates a described application program internal memory service condition, and described primary key value and the first predetermined threshold value are compared, obtain the first comparative result; If described the first comparative result is described primary key value, be greater than described the first predetermined threshold value, determine RAM leakage has occurred, utilize described operating user interface information and described memory information to generate a warning message; Receive after a trigger message, export described warning message.
Operation information when first user has been provided in the method providing in the embodiment of the present invention the user interface executable operations of an application program, and the service condition of supervisory system internal memory simultaneously; When monitoring Installed System Memory, use appearance abnormal, can be by memory abnormal situation and user's operation information in conjunction with generating corresponding warning.If in the time of by said method subsequent detection personnel detection system problem, can directly transfer the warning message of having stored and analyze for testing staff.Thereby the off-line of having realized memory leak detecting is used, and can, in the application development debug phase, by tester, carry out free test, pressure test etc.;
Because preserved corresponding user's operation information when finding Installed System Memory problem, so testing staff can determine the special scenes that equipment goes wrong when detected electrons equipment failure.When detecting while there is memory leak issue, can contrast specific operation scene, analyze corresponding LOG information, be convenient to the problem that in the quick finder of developer, internal memory is used.And method step provided by the invention is easy, without tester, grasp the using method of the professional tools such as DDMS.
As shown in Figure 1, the embodiment of the present invention provides a kind of method of monitoring memory overflow, below in conjunction with Figure of description, the specific embodiment of the present invention is elaborated:
The method of the embodiment of the present invention is applied in an electronic equipment, and this electronic equipment first electronic equipment can be computer, mobile phone, also can be the electronic equipment such as dull and stereotyped, and the method specifically comprises:
Step 101, monitor user ' is for the operating user interface information of an application program (Us er ' sInterface, UI operation), and the operating user interface information that monitors of storage;
Wherein, the storage space using while storing described user interface information for reducing, the operating user interface information that storage monitors comprises:
Detect the operating user interface number of times of having stored and whether surpass Second Threshold, if so, utilize and newly monitor the operating user interface information that the covering of operating user interface information has been stored.In this embodiment, described Second Threshold can be 20-30 user's operation.
In addition, in order to make the operating user interface information of last storage, be that time of occurring with Memory Leaks is immediate, so utilize the mode that newly monitors the operating user interface information that operating user interface information covers to store to be:
Determine the corresponding storage time of each operating user interface information of having stored;
Utilize the operating user interface information updating newly monitoring apart from the corresponding operating user interface information of current time operating user interface farthest.
Above-mentioned renewal operation can be called operation rollback, and specific implementation can be that pointer is got back to file header, makes new operating user interface input information cover old operating user interface information.
Wherein said operating user interface information comprises the character string information that operational controls action message, user input in dialog box.
Recording described operating user interface information is a kind of technology in automatic test, finger is after UI program starts, control situation on monitoring UI interface, from system message or application memory, obtain any operation of user's input, comprise and record operational controls action (such as click, log press, scroll etc.) and the character string information of inputting in dialog box.
In addition, for the ease of the output of information, so before the operating user interface information that storage monitors, further the operating user interface information detecting is converted to default script.
In addition, the information user who is converted into default script can browse or the technical operation of later stage compilation.
Step 102, supervisory system internal memory service condition, obtains the memory information of system;
In different systems, different according to the order of using, the memory information that order presents also can be different.So during supervisory system internal memory service condition, the order of using is not identical yet in the embodiment of the present invention.When concrete operations, need to just filter according to the importance of the internal storage state of each Memory System information representative, and these important indicator information are monitored.
When if the system in described electronic equipment is Android system or linux system, described supervisory system internal memory service condition, the memory information that obtains system comprises:
The physical memory that the process of the application program detecting is taken alone, supervisory system used internal memory situation or free memory situation information, detect memory information corresponding record that the machine heap memory and dalvik use in default field value.
Step 103 is obtained the primary key value that indicates a described application program internal memory service condition, and described primary key value and the first predetermined threshold value is compared from described memory information, obtains the first comparative result;
Step 104, is greater than described the first predetermined threshold value if described the first comparative result is described primary key value, determines RAM leakage has occurred, and utilizes described operating user interface information and described memory information to generate a warning message;
Step 105, receives after a trigger message, exports described warning message.
For how after receiving a trigger message, export described warning message, specific implementation process is illustrated as: when testing staff determines that Memory Leaks appears in described electronic equipment, can adopt the specific function of the application-specific in another electronic equipment to read out the warning message of storage, according to warning message, in the operating user interface information comprising, determine while there is memory leak issue, corresponding special scenes, thereby according to contrast specific operation scene, analyze corresponding LOG information, be convenient to the problem that in the quick finder of developer, internal memory is used.And method step provided by the invention is easy, without tester, grasp the using method of the professional tools such as DDMS.
In the method that the embodiment of the present invention provides, for supervisory system internal memory service condition described in different systems, the memory information specific implementation that obtains system can be;
(1) for Android system and linux system, when carrying out Installed System Memory information monitoring, by default order, to obtain, the order of specific implementation monitoring comprises:
VSS, the RSS of A, each process of Procrank order, PSS and USS information, the virtual consumption internal memory of VSS-VirtualSet Size (comprising the internal memory that shared library takies), the actual use of RSS-Resident Set Size physical memory (comprising the internal memory that shared library takies), the physical memory (internal memory that proportional distribution shared library takies) of the actual use of PSS-Proportional Set Size and the physical memory that USS-Unique Set Size process takies alone (do not comprise the internal memory that shared library takies.Generally EMS memory occupation size has following rule: VSS >=RSS >=PSS >=USS.
If monitor merely the internal memory service condition of certain process, 4 class internal memories above consume information, and USS can illustrate whether internal memory occurs the parameter of RAM leakage situation, because it has represented the internal memory situation that this process is used that belongs to, after this process is switched off, its internal memory can be released completely.So procrank order, monitors USS parameter.
B, Android system and linux system all provide free order, this order can be obtained total, used, free, the size of shared and buffers, this order is mainly the internal memory situation of monitoring whole system, obtain the internal memory service condition of whole system, but in the invention process, just need to pay close attention in free and used information wherein one, they have represented respectively the remaining internal memory that system is current and the memory size having used, and two kinds of sums are exactly the value of total.
C, in Android system, except procrank and free order, also provide dumpsysmeminfo, this order can be carried out for certain program, and shows the memory usage information of this program, and the order meeting of the memory information presenting before is more.In dumpsys meminfo order, the information that the embodiment of the present invention need to be paid close attention to is the Heap information that Davlik is relevant with Native;
Heap Size: total size of heap;
Heap Alloc: the heap size of having distributed;
Heap Free: remaining heap size;
Native heap: use C the internal memory that distributes on heap of C++;
The internal memory that Dalvik heap:dalvik is used is mainly the memory size that uses java to distribute in upper layer application java heap;
Restriction for single program internal memory is the restriction to Native heap and Dalvik heap sum, so between this two classes memory information, is that mutual balance restricts, and when the internal memory of certain class is used increase, another kind of internal memory can use amount also just dwindle.For certain upper layer application, if there is RAM leakage, so after each run finishes, the value of the Native Heap Alloc that it is corresponding or Dalvik Heap Alloc will constantly increase, final because surpass the internal memory SC service ceiling of the single program of regulation, and cause producing OOM (Out Of Memory), even cause system crash.
(2), under Windows system, the mode that realizes internal memory monitoring comprises two kinds, can be specifically:
A, " performance " instrument perfmon.msc that can carry by system monitors the memory of whole system, and this performance tool also provides report form data.
B, in addition, Windows system also can be passed through the internal memory service condition of task manager Real-Time Monitoring process.
If monitor the internal memory situation of certain application program under Windows, can in its source code, add the debugging heap function of CRT (C Run-Time library, C run-time library), and under Debug pattern working procedure, to carry out the monitoring of RAM leakage.Concrete function is as follows:
1. enable debugging heap function
#define_CRTDBG_MAP_ALLOC
#include<stdlib.h>
#include<crtdbg.h>
2. observe internal storage state function:
3. monitor RAM leakage function:
Operation information when first user has been provided in the method providing in the embodiment of the present invention the user interface executable operations of an application program, and the service condition of supervisory system internal memory simultaneously; When monitoring Installed System Memory, use appearance abnormal, can be by memory abnormal situation and user's operation information in conjunction with generating corresponding warning.If in the time of by said method subsequent detection personnel detection system problem, can directly transfer the warning message of having stored and analyze for testing staff.Thereby the off-line of having realized memory leak detecting is used, and can, in the application development debug phase, by tester, carry out free test, pressure test etc.;
Because preserved corresponding user's operation information when finding Installed System Memory problem, so testing staff can determine the special scenes that equipment goes wrong when detected electrons equipment failure, while there is memory leak issue, can contrast specific operation scene, analyze corresponding LOG information, be convenient to the problem that in the quick finder of developer, internal memory is used.And method step provided by the invention is easy, without tester, grasp the using method of the professional tools such as DDMS.
As shown in Figure 2, according to said method, the invention provides a kind of device of monitoring memory overflow, this application of installation is in an electronic equipment, and this device comprises:
Operation information acquisition module 201, the operating user interface information for monitor user ' for an application program, and store the operating user interface information monitoring;
Memory information detection module 202, for supervisory system internal memory service condition, obtains the memory information of system;
The first comparison module 203, for obtain the primary key value that indicates a described application program internal memory service condition from described memory information, and compares described primary key value and the first predetermined threshold value, obtains the first comparative result;
Warning message generation module 204, is greater than described the first predetermined threshold value if described the first comparative result is described primary key value, for determining, RAM leakage has occurred, and utilizes described operating user interface information and described memory information to generate a warning message;
Message output module 205, for receiving after a trigger message, exports described warning message.
Wherein, the storage space using while storing described user interface information for reducing, the operating user interface information that storage monitors comprises:
Whether described operation information acquisition module 201 also surpasses Second Threshold for detection of the operating user interface number of times of having stored, and if so, utilizes and newly monitors the operating user interface information that the covering of operating user interface information has been stored.
In addition, in order to make the operating user interface information of last storage, be that time of occurring with Memory Leaks is immediate, described operation information acquisition module 201 is utilized and is newly monitored the operating user interface information that operating user interface information covers to store and can be:
Described operation information acquisition module 201 is also for determining the corresponding storage time of each operating user interface information of having stored; Utilize the operating user interface information updating newly monitoring apart from the corresponding operating user interface information of current time operating user interface farthest.
In addition, for the ease of the output of information, this device comprises modular converter, before the operating user interface information monitoring in storage, for the operating user interface information detecting is converted to default script.
In different systems, different according to the order of using, the memory information that order presents also can be different.So during supervisory system internal memory service condition, the order of using is not identical yet in the embodiment of the present invention.When concrete operations, need to just filter according to the importance of the internal storage state of each Memory System information representative, and these important indicator information are monitored.So when the system in described electronic equipment is Android system or linux system;
Described memory information detection module 202 has also been used internal memory situation or free memory situation information, has detected memory information corresponding record that the machine heap memory and dalvik use to default field value for physical memory, supervisory system that the process of the application program detecting is taken alone.
Above-mentioned one or more technical schemes in the embodiment of the present application, at least have following technique effect:
Operation information when first user has been provided in the method providing in the embodiment of the present invention the user interface executable operations of an application program, and the service condition of supervisory system internal memory simultaneously; When monitoring Installed System Memory, use appearance abnormal, can be by memory abnormal situation and user's operation information in conjunction with generating corresponding warning.If in the time of by said method subsequent detection personnel detection system problem, can directly transfer the warning message of having stored and analyze for testing staff.Thereby the off-line of having realized memory leak detecting is used, and can, in the application development debug phase, by tester, carry out free test, pressure test etc.;
Because preserved corresponding user's operation information when finding Installed System Memory problem, so testing staff can determine the special scenes that equipment goes wrong when detected electrons equipment failure, while there is memory leak issue, can contrast specific operation scene, analyze corresponding LOG information, be convenient to the problem that in the quick finder of developer, internal memory is used.And method step provided by the invention is easy, without tester, grasp the using method of the professional tools such as DDMS.
Method provided by the present invention is used on system backstage, there is the user's at no distant date of Memory Leaks UI operation in crawl, supervisory system internal memory situation, when some scene causes memory overflow, preserve operation scenario and system information, for the application development debug phase, provide a kind of aided debugging method of efficiently and accurately.
Method of the present invention is not limited to the embodiment described in embodiment, and those skilled in the art's technical scheme according to the present invention draws other embodiment, belongs to equally technological innovation scope of the present invention.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if within of the present invention these are revised and modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.

Claims (10)

1. monitor a method for memory overflow, the method is applied to, in an electronic equipment, it is characterized in that, the method comprises:
Monitor user ' is for the operating user interface information of an application program, and the operating user interface information that monitors of storage;
Supervisory system internal memory service condition, obtains the memory information of system;
From described memory information, obtain the primary key value that indicates a described application program internal memory service condition, and described primary key value and the first predetermined threshold value are compared, obtain the first comparative result;
If described the first comparative result is described primary key value, be greater than described the first predetermined threshold value, determine RAM leakage has occurred, utilize described operating user interface information and described memory information to generate a warning message;
Receive after a trigger message, export described warning message.
2. the method for claim 1, is characterized in that, the operating user interface information that storage monitors comprises:
Detect the operating user interface number of times of having stored and whether surpass Second Threshold, if so, utilize and newly monitor the operating user interface information that the covering of operating user interface information has been stored.
3. method as claimed in claim 2, is characterized in that, utilizes newly to monitor the operating user interface information that operating user interface information covers to store and comprise:
Determine the corresponding storage time of each operating user interface information of having stored;
Utilize the operating user interface information updating newly monitoring apart from the corresponding operating user interface information of current time operating user interface farthest.
4. the method for claim 1, is characterized in that, described operating user interface information comprises the character string information that operational controls action message, user input in dialog box.
5. the method for claim 1, is characterized in that, when the system in described electronic equipment is Android system or linux system, and described supervisory system internal memory service condition, the memory information that obtains system comprises:
The physical memory that the process of the application program detecting is taken alone, supervisory system used internal memory situation or free memory situation information, detect memory information corresponding record that the machine heap memory and dalvik use in default field value.
6. monitor a device for memory overflow, this application of installation, in an electronic equipment, is characterized in that, this device comprises:
Operation information acquisition module, the operating user interface information for monitor user ' for an application program, and store the operating user interface information monitoring;
Memory information detection module, for supervisory system internal memory service condition, obtains the memory information of system;
The first comparison module, for obtain the primary key value that indicates a described application program internal memory service condition from described memory information, and compares described primary key value and the first predetermined threshold value, obtains the first comparative result;
Warning message generation module, is greater than described the first predetermined threshold value if described the first comparative result is described primary key value, for determining, RAM leakage has occurred, and utilizes described operating user interface information and described memory information to generate a warning message;
Message output module, for receiving after a trigger message, exports described warning message.
7. device as claimed in claim 6, it is characterized in that, whether described operation information acquisition module also surpasses Second Threshold for detection of the operating user interface number of times of having stored, and if so, utilizes and newly monitors the operating user interface information that the covering of operating user interface information has been stored.
8. device as claimed in claim 7, is characterized in that, described operation information acquisition module is also for determining the corresponding storage time of each operating user interface information of having stored; Utilize the operating user interface information updating newly monitoring apart from the corresponding operating user interface information of current time operating user interface farthest.
9. device as claimed in claim 6, is characterized in that, this device comprises modular converter, before the operating user interface information monitoring in storage, for the operating user interface information detecting is converted to default script.
10. device as claimed in claim 6, it is characterized in that, when the system in described electronic equipment is Android system or linux system, memory information detection module has also been used internal memory situation or free memory situation information, has detected memory information corresponding record that the machine heap memory and dalvik use to default field value for physical memory, supervisory system that the process of the application program detecting is taken alone.
CN201310195512.3A 2013-05-23 2013-05-23 A kind of method and device for monitoring memory overflow Active CN104182320B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310195512.3A CN104182320B (en) 2013-05-23 2013-05-23 A kind of method and device for monitoring memory overflow

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310195512.3A CN104182320B (en) 2013-05-23 2013-05-23 A kind of method and device for monitoring memory overflow

Publications (2)

Publication Number Publication Date
CN104182320A true CN104182320A (en) 2014-12-03
CN104182320B CN104182320B (en) 2017-09-29

Family

ID=51963387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310195512.3A Active CN104182320B (en) 2013-05-23 2013-05-23 A kind of method and device for monitoring memory overflow

Country Status (1)

Country Link
CN (1) CN104182320B (en)

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484606A (en) * 2014-12-05 2015-04-01 国云科技股份有限公司 Verification method for memory information confidentiality of virtualization platform
CN104534285A (en) * 2014-12-26 2015-04-22 福建智恒电子新技术有限公司 Energy consumption anomaly monitoring method and device
CN104866409A (en) * 2015-05-29 2015-08-26 小米科技有限责任公司 Method and apparatus for monitoring memory leakage
CN104991847A (en) * 2015-07-03 2015-10-21 厦门美图移动科技有限公司 Memory leakage automatic testing method and apparatus and mobile terminal
CN105049933A (en) * 2015-07-14 2015-11-11 四川长虹电器股份有限公司 Automatic recording monitoring method of memory of smart TV
CN105243003A (en) * 2015-09-09 2016-01-13 浪潮(北京)电子信息产业有限公司 Memory allocation monitoring method and apparatus
CN105373479A (en) * 2015-12-14 2016-03-02 厦门美图移动科技有限公司 Automatic test method and device of memory leakage and mobile terminal
CN105487971A (en) * 2014-12-22 2016-04-13 哈尔滨安天科技股份有限公司 Method and system for recording and reproducing operation steps in software testing
CN105573811A (en) * 2015-12-15 2016-05-11 广州品唯软件有限公司 System internal memory control method and system thereof
CN105740122A (en) * 2016-01-26 2016-07-06 广东欧珀移动通信有限公司 Method and system for monitoring mobile phone memory leak
CN105808219A (en) * 2014-12-29 2016-07-27 中国移动通信集团公司 Memory space allocation method and apparatus
CN106257426A (en) * 2016-01-27 2016-12-28 上海华测导航技术股份有限公司 Method for detecting memory leakage based on GNSS receiver
CN106354627A (en) * 2016-07-21 2017-01-25 努比亚技术有限公司 Method and system for detecting memory leakage of application program
CN106383743A (en) * 2016-09-27 2017-02-08 腾讯科技(深圳)有限公司 Business processing method and system
CN106528430A (en) * 2016-12-01 2017-03-22 北京金山安全软件有限公司 Application program detection method and device and electronic equipment
CN106886476A (en) * 2017-02-08 2017-06-23 腾讯科技(深圳)有限公司 A kind of memory analysis method of client, apparatus and system
CN108073441A (en) * 2016-11-14 2018-05-25 阿里巴巴集团控股有限公司 A kind of virutal machine memory monitoring and managing method and equipment
CN108255687A (en) * 2017-12-29 2018-07-06 五八同城信息技术有限公司 Application program internal memory monitoring test method, device and the electronic equipment of terminal
CN108334435A (en) * 2018-01-18 2018-07-27 杭州迪普科技股份有限公司 A kind of based reminding method and device of shared drive leakage
CN108984295A (en) * 2018-06-19 2018-12-11 珠海全志科技股份有限公司 Method for recovering internal storage, computer installation and computer readable storage medium
CN109298959A (en) * 2017-07-25 2019-02-01 华为技术有限公司 A kind of memory abnormal detection method and equipment
CN109828885A (en) * 2018-12-15 2019-05-31 中国平安人寿保险股份有限公司 RocketMQ internal memory monitoring method, device, electronic equipment and storage medium
CN110704313A (en) * 2019-09-25 2020-01-17 北京宝兰德软件股份有限公司 Memory leakage detection method and device for JAVA virtual machine
CN110858178A (en) * 2018-08-07 2020-03-03 广州小鹏汽车科技有限公司 Memory recovery method, device, equipment and medium
CN111274060A (en) * 2020-02-10 2020-06-12 广州虎牙科技有限公司 Method, device, equipment and storage medium for determining memory abnormity
CN112988490A (en) * 2021-04-21 2021-06-18 浙江乾冠信息安全研究院有限公司 Memory leak detection method and device, electronic equipment and medium
CN117453446A (en) * 2023-12-15 2024-01-26 荣耀终端有限公司 Auxiliary information acquisition method for memory leakage positioning and electronic equipment
CN117707920A (en) * 2023-08-31 2024-03-15 荣耀终端有限公司 Memory leakage positioning method, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050076184A1 (en) * 2003-10-01 2005-04-07 Schumacher Michael K. Apparatus and method for detecting memory leaks
CN101599048A (en) * 2009-07-01 2009-12-09 福建星网锐捷网络有限公司 A kind of method and apparatus of internal memory monitoring
CN101794567A (en) * 2010-02-10 2010-08-04 中兴通讯股份有限公司 Method and terminal for loading pictures

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050076184A1 (en) * 2003-10-01 2005-04-07 Schumacher Michael K. Apparatus and method for detecting memory leaks
CN101599048A (en) * 2009-07-01 2009-12-09 福建星网锐捷网络有限公司 A kind of method and apparatus of internal memory monitoring
CN101794567A (en) * 2010-02-10 2010-08-04 中兴通讯股份有限公司 Method and terminal for loading pictures

Cited By (40)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484606A (en) * 2014-12-05 2015-04-01 国云科技股份有限公司 Verification method for memory information confidentiality of virtualization platform
CN105487971A (en) * 2014-12-22 2016-04-13 哈尔滨安天科技股份有限公司 Method and system for recording and reproducing operation steps in software testing
CN104534285A (en) * 2014-12-26 2015-04-22 福建智恒电子新技术有限公司 Energy consumption anomaly monitoring method and device
CN104534285B (en) * 2014-12-26 2017-02-22 福建智恒电子新技术有限公司 Energy consumption anomaly monitoring method and device
CN105808219B (en) * 2014-12-29 2019-06-25 中国移动通信集团公司 A kind of memory headroom distribution method and device
CN105808219A (en) * 2014-12-29 2016-07-27 中国移动通信集团公司 Memory space allocation method and apparatus
CN104866409A (en) * 2015-05-29 2015-08-26 小米科技有限责任公司 Method and apparatus for monitoring memory leakage
CN104991847B (en) * 2015-07-03 2018-11-23 厦门美图移动科技有限公司 A kind of RAM leakage automated detection method, device and mobile terminal
CN104991847A (en) * 2015-07-03 2015-10-21 厦门美图移动科技有限公司 Memory leakage automatic testing method and apparatus and mobile terminal
CN105049933A (en) * 2015-07-14 2015-11-11 四川长虹电器股份有限公司 Automatic recording monitoring method of memory of smart TV
CN105243003A (en) * 2015-09-09 2016-01-13 浪潮(北京)电子信息产业有限公司 Memory allocation monitoring method and apparatus
CN105373479A (en) * 2015-12-14 2016-03-02 厦门美图移动科技有限公司 Automatic test method and device of memory leakage and mobile terminal
CN105573811A (en) * 2015-12-15 2016-05-11 广州品唯软件有限公司 System internal memory control method and system thereof
CN105573811B (en) * 2015-12-15 2018-12-07 广州品唯软件有限公司 Installed System Memory control method and its system
CN105740122A (en) * 2016-01-26 2016-07-06 广东欧珀移动通信有限公司 Method and system for monitoring mobile phone memory leak
CN105740122B (en) * 2016-01-26 2019-07-26 Oppo广东移动通信有限公司 A kind of monitoring method and monitoring system of mobile phone EMS memory leakage
CN106257426A (en) * 2016-01-27 2016-12-28 上海华测导航技术股份有限公司 Method for detecting memory leakage based on GNSS receiver
CN106354627A (en) * 2016-07-21 2017-01-25 努比亚技术有限公司 Method and system for detecting memory leakage of application program
CN106383743A (en) * 2016-09-27 2017-02-08 腾讯科技(深圳)有限公司 Business processing method and system
CN108073441A (en) * 2016-11-14 2018-05-25 阿里巴巴集团控股有限公司 A kind of virutal machine memory monitoring and managing method and equipment
CN108073441B (en) * 2016-11-14 2022-05-10 阿里巴巴集团控股有限公司 Virtual machine memory supervision method and equipment
CN106528430A (en) * 2016-12-01 2017-03-22 北京金山安全软件有限公司 Application program detection method and device and electronic equipment
CN106528430B (en) * 2016-12-01 2019-03-26 北京金山安全软件有限公司 Application program detection method and device and electronic equipment
CN106886476A (en) * 2017-02-08 2017-06-23 腾讯科技(深圳)有限公司 A kind of memory analysis method of client, apparatus and system
CN106886476B (en) * 2017-02-08 2022-08-12 腾讯科技(深圳)有限公司 Memory analysis method, device and system for client
CN109298959A (en) * 2017-07-25 2019-02-01 华为技术有限公司 A kind of memory abnormal detection method and equipment
US11513932B2 (en) 2017-07-25 2022-11-29 Huawei Technologies Co., Ltd. Memory anomaly detection method and device
CN109298959B (en) * 2017-07-25 2021-09-21 华为技术有限公司 Memory anomaly detection method and equipment
CN108255687A (en) * 2017-12-29 2018-07-06 五八同城信息技术有限公司 Application program internal memory monitoring test method, device and the electronic equipment of terminal
CN108334435A (en) * 2018-01-18 2018-07-27 杭州迪普科技股份有限公司 A kind of based reminding method and device of shared drive leakage
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
CN110858178A (en) * 2018-08-07 2020-03-03 广州小鹏汽车科技有限公司 Memory recovery method, device, equipment and medium
CN109828885A (en) * 2018-12-15 2019-05-31 中国平安人寿保险股份有限公司 RocketMQ internal memory monitoring method, device, electronic equipment and storage medium
CN110704313A (en) * 2019-09-25 2020-01-17 北京宝兰德软件股份有限公司 Memory leakage detection method and device for JAVA virtual machine
CN111274060A (en) * 2020-02-10 2020-06-12 广州虎牙科技有限公司 Method, device, equipment and storage medium for determining memory abnormity
CN112988490A (en) * 2021-04-21 2021-06-18 浙江乾冠信息安全研究院有限公司 Memory leak detection method and device, electronic equipment and medium
CN117707920A (en) * 2023-08-31 2024-03-15 荣耀终端有限公司 Memory leakage positioning method, electronic equipment and storage medium
CN117453446A (en) * 2023-12-15 2024-01-26 荣耀终端有限公司 Auxiliary information acquisition method for memory leakage positioning and electronic equipment
CN117453446B (en) * 2023-12-15 2024-04-26 荣耀终端有限公司 Auxiliary information acquisition method for memory leakage positioning and electronic equipment

Also Published As

Publication number Publication date
CN104182320B (en) 2017-09-29

Similar Documents

Publication Publication Date Title
CN104182320A (en) Method and device for monitoring leakage of memory
US7765528B2 (en) Identifying sources of memory retention
US8141053B2 (en) Call stack sampling using a virtual machine
US7991961B1 (en) Low-overhead run-time memory leak detection and recovery
CN101295268B (en) Partition memory dumping method and device facing software system
US7313661B1 (en) Tool for identifying causes of memory leaks
US7900198B2 (en) Method and system for parameter profile compiling
KR101983413B1 (en) Managing object lifetime in a cyclic graph
US8196116B2 (en) Tracing objects in object-oriented programming model
Lengauer et al. Accurate and efficient object tracing for java applications
CN107066390B (en) Dynamic memory leak detection method and system
US9558055B2 (en) System level memory leak detection
US20060206885A1 (en) Identifying memory leaks in computer systems
US20060085156A1 (en) Method and system for predicting memory leaks from unit testing
US20150006961A1 (en) Capturing trace information using annotated trace output
KR20110124733A (en) Detection of method calls to streamline diagnosis of custom code through dynamic instrumentation
CN104077220A (en) Method and device for debugging microprocessor without interlocked piped stages (MIPS) framework operating system kernel
Matias et al. Monitoring memory-related software aging: An exploratory study
CN104516817A (en) Memory leak detection method and device
US7657792B2 (en) Identifying race conditions involving asynchronous memory updates
Langner et al. Detection and root cause analysis of memory-related software aging defects by automated tests
Qian et al. Inferring weak references for fixing Java memory leaks
Lengauer et al. Where has all my memory gone? determining memory characteristics of product variants using virtual-machine-level monitoring
Cornejo et al. Field monitoring with delayed saving
Goldstein et al. Can self-healing software cope with loitering?

Legal Events

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