CN105204996A - Memory leak detection device and method and terminal - Google Patents

Memory leak detection device and method and terminal Download PDF

Info

Publication number
CN105204996A
CN105204996A CN201510615560.2A CN201510615560A CN105204996A CN 105204996 A CN105204996 A CN 105204996A CN 201510615560 A CN201510615560 A CN 201510615560A CN 105204996 A CN105204996 A CN 105204996A
Authority
CN
China
Prior art keywords
tested process
occupation value
variation tendency
memory occupation
ems memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510615560.2A
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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201510615560.2A priority Critical patent/CN105204996A/en
Publication of CN105204996A publication Critical patent/CN105204996A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a memory leak detection device. The device comprises a collection module used for collecting memory sampling information of a detected progress, a generation module used for generating the change trend of the memory occupation value of the detected progress, and a detection module used for judging whether memory leak happens to the detected progress or not according to the change trend of the memory occupation value of the detected progress. The memory sampling information includes the sampling time and the memory occupation value, at the sampling time, of the detected progress. The invention further discloses a memory leak detection method and a terminal. By means of the memory leak detection device and method and the terminal, the memory leak detection accuracy can be improved.

Description

Memory leak detecting device and method, terminal
Technical field
The present invention relates to computer realm, particularly relate to a kind of memory leak detecting device and method, terminal.
Background technology
In computer science, RAM leakage refers to that being assigned with internal memory uses to certain process, and this process does not have releasing memory after using internal memory, causes the internal memory distributed cannot recycling.Along with the operation of process, the available internal memory in system will be fewer and feweri, causes system to be paralysed owing to not having enough internal memories, cause and have a strong impact on.RAM leakage may be because developer is inconsiderate, and the code write exists hidden danger could not releasing memory in time, also may be that exception has appearred in system, not have releasing memory to cause.
At present, the method that test memory is revealed has a lot, mostly all relate to relevant software code, locate in the code of tested process by Walkthrough, repeatedly debugging the point that there is RAM leakage, also can position by the instrument that such as ccmalloc, Leaky etc. are relevant, judge whether tested process exists RAM leakage.Adopt existing RAM leakage test mode, there is interference large, test inaccurate defect.
Summary of the invention
Fundamental purpose of the present invention is to propose a kind of memory leak detecting device and method, terminal, is intended to solve in prior art, to the inaccurate technical matters of the memory leak detecting of tested process.
For achieving the above object, the invention provides a kind of memory leak detecting device, this device comprises:
Acquisition module, for gathering the internal memory sample information of tested process, described internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to described sampling time;
Generation module, for generating the variation tendency of the EMS memory occupation value of described tested process;
Detection module, for the variation tendency of the EMS memory occupation value according to described tested process, judges whether described tested process exists RAM leakage.
Optionally, described detection module also for, when the variation tendency of the EMS memory occupation value of described tested process is increasing trend, judge that described tested process exists RAM leakage, otherwise, judge that described tested process does not exist RAM leakage.
Optionally, described device also comprises:
Acquisition module, for obtaining test script, described test script is shell script;
Described acquisition module, also gathers the internal memory sample information of tested process for running shell script.
Optionally, described device also comprises:
Locating module, for when described tested process exists RAM leakage, locates object or the code segment of tested process generation RAM leakage according to the variation tendency of the EMS memory occupation value of described tested process.
Optionally, described device also comprises:
Sending module, internal memory sample information for the tested process by described collection sends to monitor terminal, with the variation tendency making described monitor terminal generate the EMS memory occupation value of described tested process, and the variation tendency of EMS memory occupation value according to described tested process, judge whether described tested process exists RAM leakage.
In addition, for achieving the above object, the present invention also proposes a kind of method for detecting memory leakage, and the method comprises:
Gather the internal memory sample information of tested process, described internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to described sampling time;
Generate the variation tendency of the EMS memory occupation value of described tested process;
According to the variation tendency of the EMS memory occupation value of described tested process, judge whether described tested process exists RAM leakage.
Optionally, the variation tendency of the described EMS memory occupation value according to described tested process, judges that the step whether described tested process exists RAM leakage comprises:
If the variation tendency of the EMS memory occupation value of described tested process is increasing trend, then judge that described tested process exists RAM leakage, otherwise, judge that described tested process does not exist RAM leakage.
Optionally, the variation tendency of the described EMS memory occupation value according to described tested process, after judging whether described tested process exists the step of RAM leakage, the method also comprises:
When described tested process exists RAM leakage, according to object or the code segment of the described tested process generation RAM leakage in variation tendency location of the EMS memory occupation value of described tested process.
Optionally, the internal memory sample information of the tested process of described collection, described internal memory sample information comprises sampling time, tested process after the step of EMS memory occupation value corresponding to described sampling time, and the method also comprises:
The internal memory sample information of the tested process of described collection is sent to monitor terminal, with the variation tendency making described monitor terminal generate the EMS memory occupation value of described tested process, and the variation tendency of EMS memory occupation value according to described tested process, judge whether described tested process exists RAM leakage.
In addition, for achieving the above object, the present invention also proposes a kind of terminal, and described terminal comprises the memory leak detecting device described in above-mentioned any one.
Memory leak detecting device and method, terminal that the present invention proposes, described memory leak detecting device comprises: acquisition module, for gathering the internal memory sample information of tested process, described internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to described sampling time; Generation module, for generating the variation tendency of the EMS memory occupation value of described tested process; Detection module, for the variation tendency of the EMS memory occupation value according to described tested process, judges whether described tested process exists RAM leakage.Use technical scheme provided by the invention can at the bottom testing results script of the terminal at this tested process place, collect the internal memory sample information of tested process accurately, judge whether tested process RAM leakage occurs according to the internal memory sample information collected again, the accuracy of memory leak detecting can be improved.
Accompanying drawing explanation
Fig. 1 is the hardware configuration schematic diagram of the mobile terminal realizing each embodiment of the present invention;
Fig. 2 is the radio communication device schematic diagram of mobile terminal as shown in Figure 1;
Fig. 3 is the structural representation of the first embodiment of memory leak detecting device of the present invention;
Fig. 4 is at a time the consumed internal memory situation schematic diagram of tested process;
Fig. 5 is the schematic diagram of the variation tendency of the EMS memory occupation value of tested process;
Fig. 6 is the structural representation of the second embodiment of memory leak detecting device of the present invention;
Fig. 7 is the structural representation of the 3rd embodiment of memory leak detecting device of the present invention;
Fig. 8 is the structural representation of the 4th embodiment of memory leak detecting device of the present invention;
Fig. 9 is the schematic flow sheet of the first embodiment of method for detecting memory leakage of the present invention;
Figure 10 is the schematic flow sheet of the second embodiment of method for detecting memory leakage of the present invention;
Figure 11 is the schematic flow sheet of the 3rd embodiment of method for detecting memory leakage of the present invention.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, are described further with reference to accompanying drawing.
Embodiment
Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The mobile terminal realizing each embodiment of the present invention is described referring now to accompanying drawing.In follow-up description, use the suffix of such as " module ", " parts " or " unit " for representing element only in order to be conducive to explanation of the present invention, itself is specific meaning not.Therefore, " module " and " parts " can mixedly use.
Mobile terminal can be implemented in a variety of manners.Such as, the terminal described in the present invention can comprise the such as mobile terminal of mobile phone, smart phone, notebook computer, digit broadcasting receiver, PDA (personal digital assistant), PAD (panel computer), PMP (portable media player), guider etc. and the fixed terminal of such as digital TV, desk-top computer etc.Below, suppose that terminal is mobile terminal.But it will be appreciated by those skilled in the art that except the element except being used in particular for mobile object, structure according to the embodiment of the present invention also can be applied to the terminal of fixed type.
Fig. 1 is the hardware configuration signal of the mobile terminal realizing each embodiment of the present invention.
Mobile terminal 100 can comprise wireless communication unit 110, A/V (audio/video) input block 120, user input unit 130, sensing cell 140, output unit 150, storer 160, interface unit 170, controller 180 and power supply unit 190 etc.Fig. 1 shows the mobile terminal with various assembly, it should be understood that, does not require to implement all assemblies illustrated.Can alternatively implement more or less assembly.Will be discussed in more detail below the element of mobile terminal.
Wireless communication unit 110 generally includes one or more assembly, and it allows the wireless communication between mobile terminal 100 and radio communication device or network.Such as, wireless communication unit can comprise at least one in broadcast reception module 111, mobile communication module 112, wireless Internet module 113, short range communication module 114 and positional information module 115.
Broadcast reception module 111 via broadcast channel from external broadcasting management server receiving broadcast signal and/or broadcast related information.Broadcast channel can comprise satellite channel and/or terrestrial channel.Broadcast management server can be generate and send the server of broadcast singal and/or broadcast related information or the broadcast singal generated before receiving and/or broadcast related information and send it to the server of terminal.Broadcast singal can comprise TV broadcast singal, radio signals, data broadcasting signal etc.And broadcast singal may further include the broadcast singal combined with TV or radio signals.Broadcast related information also can provide via mobile communications network, and in this case, broadcast related information can be received by mobile communication module 112.Broadcast singal can exist in a variety of manners, such as, it can exist with the form of the electronic service guidebooks (ESG) of the electronic program guides of DMB (DMB) (EPG), digital video broadcast-handheld (DVB-H) etc.Broadcast reception module 111 can by using the broadcast of various types of broadcaster Received signal strength.Especially, broadcast reception module 111 can by using such as multimedia broadcasting-ground (DMB-T), DMB-satellite (DMB-S), digital video broadcasting-hand-held (DVB-H), forward link media (MediaFLO ) data broadcast device, received terrestrial digital broadcasting integrated service (ISDB-T) etc. digital broadcast apparatus receive digital broadcasting.Broadcast reception module 111 can be constructed to be applicable to providing the various broadcaster of broadcast singal and above-mentioned digital broadcast apparatus.The broadcast singal received via broadcast reception module 111 and/or broadcast related information can be stored in storer 160 (or storage medium of other type).
Radio signal is sent at least one in base station (such as, access point, Node B etc.), exterior terminal and server and/or receives radio signals from it by mobile communication module 112.Various types of data that such radio signal can comprise voice call signal, video calling signal or send according to text and/or Multimedia Message and/or receive.
Wireless Internet module 113 supports the Wi-Fi (Wireless Internet Access) of mobile terminal.This module can be inner or be externally couple to terminal.Wi-Fi (Wireless Internet Access) technology involved by this module can comprise WLAN (WLAN) (Wi-Fi), Wibro (WiMAX), Wimax (worldwide interoperability for microwave access), HSDPA (high-speed downlink packet access) etc.
Short range communication module 114 is the modules for supporting junction service.Some examples of short-range communication technology comprise bluetooth tM, radio-frequency (RF) identification (RFID), Infrared Data Association (IrDA), ultra broadband (UWB), purple honeybee tMetc..
Positional information module 115 is the modules of positional information for checking or obtain mobile terminal.The typical case of positional information module is GPS (global pick device).According to current technology, GPS module 115 calculates from the range information of three or more satellite and correct time information and for the Information application triangulation calculated, thus calculates three-dimensional current location information according to longitude, latitude and pin-point accuracy.Current, the method for calculating position and temporal information uses three satellites and by using the error of the position that goes out of an other satellite correction calculation and temporal information.In addition, GPS module 115 can carry out computing velocity information by Continuous plus current location information in real time.
A/V input block 120 is for audio reception or vision signal.A/V input block 120 can comprise camera 121 and microphone 122, and the view data of camera 121 to the static images obtained by image capture apparatus in Video Capture pattern or image capture mode or video processes.Picture frame after process may be displayed on display unit 151.Picture frame after camera 121 processes can be stored in storer 160 (or other storage medium) or via wireless communication unit 110 and send, and can provide two or more cameras 121 according to the structure of mobile terminal.Such acoustic processing can via microphones sound (voice data) in telephone calling model, logging mode, speech recognition mode etc. operational mode, and can be voice data by microphone 122.Audio frequency (voice) data after process can be converted to the formatted output that can be sent to mobile communication base station via mobile communication module 112 when telephone calling model.Microphone 122 can be implemented various types of noise and eliminate (or suppress) algorithm and receiving and sending to eliminate (or suppression) noise or interference that produce in the process of sound signal.
User input unit 130 can generate key input data to control the various operations of mobile terminal according to the order of user's input.User input unit 130 allows user to input various types of information, and keyboard, the young sheet of pot, touch pad (such as, detecting the touch-sensitive assembly of the change of the resistance, pressure, electric capacity etc. that cause owing to being touched), roller, rocking bar etc. can be comprised.Especially, when touch pad is superimposed upon on display unit 151 as a layer, touch-screen can be formed.
Sensing cell 140 detects the current state of mobile terminal 100, (such as, mobile terminal 100 open or close state), the position of mobile terminal 100, user for mobile terminal 100 contact (namely, touch input) presence or absence, the orientation of mobile terminal 100, the acceleration of mobile terminal 100 or speed is moved and direction etc., and generate order or the signal of the operation for controlling mobile terminal 100.Such as, when mobile terminal 100 is embodied as sliding-type mobile phone, sensing cell 140 can sense this sliding-type phone and open or close.In addition, whether whether sensing cell 140 can detect power supply unit 190 provides electric power or interface unit 170 to couple with external device (ED).Sensing cell 140 can comprise proximity transducer 1410 and will be described this in conjunction with touch-screen below.
Interface unit 170 is used as at least one external device (ED) and is connected the interface that can pass through with mobile terminal 100.Such as, external device (ED) can comprise wired or wireless head-band earphone port, external power source (or battery charger) port, wired or wireless FPDP, memory card port, for connecting the port, audio frequency I/O (I/O) port, video i/o port, ear port etc. of the device with identification module.Identification module can be that storage uses the various information of mobile terminal 100 for authentication of users and can comprise subscriber identification module (UIM), client identification module (SIM), Universal Subscriber identification module (USIM) etc.In addition, the device (hereinafter referred to " recognition device ") with identification module can take the form of smart card, and therefore, recognition device can be connected with mobile terminal 100 via port or other coupling arrangement.Interface unit 170 may be used for receive from external device (ED) input (such as, data message, electric power etc.) and the input received be transferred to the one or more element in mobile terminal 100 or may be used for transmitting data between mobile terminal and external device (ED).
In addition, when mobile terminal 100 is connected with external base, interface unit 170 can be used as to allow by it electric power to be provided to the path of mobile terminal 100 from base or can be used as the path that allows to be transferred to mobile terminal by it from the various command signals of base input.The various command signal inputted from base or electric power can be used as and identify whether mobile terminal is arranged on the signal base exactly.Output unit 150 is constructed to provide output signal (such as, sound signal, vision signal, alarm signal, vibration signal etc.) with vision, audio frequency and/or tactile manner.Output unit 150 can comprise display unit 151, dio Output Modules 152, alarm unit 153 etc.
Display unit 151 may be displayed on the information of process in mobile terminal 100.Such as, when mobile terminal 100 is in telephone calling model, display unit 151 can show with call or other communicate (such as, text messaging, multimedia file are downloaded etc.) be correlated with user interface (UI) or graphic user interface (GUI).When mobile terminal 100 is in video calling pattern or image capture mode, display unit 151 can the image of display capture and/or the image of reception, UI or GUI that video or image and correlation function are shown etc.
Meanwhile, when display unit 151 and touch pad as a layer superposed on one another to form touch-screen time, display unit 151 can be used as input media and output unit.Display unit 151 can comprise at least one in liquid crystal display (LCD), thin film transistor (TFT) LCD (TFT-LCD), Organic Light Emitting Diode (OLED) display, flexible display, three-dimensional (3D) display etc.Some in these displays can be constructed to transparence and watch from outside to allow user, and this can be called transparent display, and typical transparent display can be such as TOLED (transparent organic light emitting diode) display etc.According to the specific embodiment wanted, mobile terminal 100 can comprise two or more display units (or other display device), such as, mobile terminal can comprise outernal display unit (not shown) and inner display unit (not shown).Touch-screen can be used for detecting touch input pressure and touch input position and touch and inputs area.
When dio Output Modules 152 can be under the isotypes such as call signal receiving mode, call mode, logging mode, speech recognition mode, broadcast reception mode at mobile terminal, voice data convert audio signals that is that wireless communication unit 110 is received or that store in storer 160 and exporting as sound.And dio Output Modules 152 can provide the audio frequency relevant to the specific function that mobile terminal 100 performs to export (such as, call signal receives sound, message sink sound etc.).Dio Output Modules 152 can comprise acoustic pickup, hummer etc.
Alarm unit 153 can provide and export that event informed to mobile terminal 100.Typical event can comprise calling reception, message sink, key signals input, touch input etc.Except audio or video exports, alarm unit 153 can provide in a different manner and export with the generation of notification event.Such as, alarm unit 153 can provide output with the form of vibration, when receive calling, message or some other enter communication (incomingcommunication) time, alarm unit 153 can provide sense of touch to export (that is, vibrating) to notify to user.By providing such sense of touch to export, even if when the mobile phone of user is in the pocket of user, user also can identify the generation of various event.Alarm unit 153 also can provide the output of the generation of notification event via display unit 151 or dio Output Modules 152.
Storer 160 software program that can store process and the control operation performed by controller 180 etc., or temporarily can store oneself through exporting the data (such as, telephone directory, message, still image, video etc.) that maybe will export.And, storer 160 can store about when touch be applied to touch-screen time the vibration of various modes that exports and the data of sound signal.
Storer 160 can comprise the storage medium of at least one type, described storage medium comprises flash memory, hard disk, multimedia card, card-type storer (such as, SD or DX storer etc.), random access storage device (RAM), static random-access memory (SRAM), ROM (read-only memory) (ROM), Electrically Erasable Read Only Memory (EEPROM), programmable read only memory (PROM), magnetic storage, disk, CD etc.And mobile terminal 100 can be connected the memory function of execute store 160 network storage device with by network cooperates.
Controller 180 controls the overall operation of mobile terminal usually.Such as, controller 180 performs the control relevant to voice call, data communication, video calling etc. and process.In addition, controller 180 can comprise the multi-media module 181 for reproducing (or playback) multi-medium data, and multi-media module 181 can be configured in controller 180, or can be configured to be separated with controller 180.Controller 180 can pattern recognition process, is identified as character or image so that input is drawn in the handwriting input performed on the touchscreen or picture.
Power supply unit 190 receives external power or internal power and provides each element of operation and the suitable electric power needed for assembly under the control of controller 180.
Various embodiment described herein can to use such as computer software, the computer-readable medium of hardware or its any combination implements.For hardware implementation, embodiment described herein can by using application-specific IC (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), processor, controller, microcontroller, microprocessor, being designed at least one performed in the electronic unit of function described herein and implementing, in some cases, such embodiment can be implemented in controller 180.For implement software, the embodiment of such as process or function can be implemented with allowing the independent software module performing at least one function or operation.Software code can be implemented by the software application (or program) write with any suitable programming language, and software code can be stored in storer 160 and to be performed by controller 180.
So far, oneself is through the mobile terminal according to its functional description.Below, for the sake of brevity, by the slide type mobile terminal that describes in various types of mobile terminals of such as folded form, board-type, oscillating-type, slide type mobile terminal etc. exemplarily.Therefore, the present invention can be applied to the mobile terminal of any type, and is not limited to slide type mobile terminal.
Mobile terminal 100 as shown in Figure 1 can be constructed to utilize and send the such as wired and radio communication device of data via frame or grouping and satellite-based communicator operates.
Describe wherein according to the communicator that mobile terminal of the present invention can operate referring now to Fig. 2.
Such communicator can use different air interfaces and/or Physical layer.Such as, the air interface used by communicator comprises such as frequency division multiple access (FDMA), time division multiple access (TDMA) (TDMA), CDMA (CDMA) and universal mobile communications device (UMTS) (especially, Long Term Evolution (LTE)), global mobile communication device (GSM) etc.As non-limiting example, description below relates to cdma communication device, but such instruction is equally applicable to the device of other type.
With reference to figure 2, cdma wireless communication device can comprise multiple mobile terminal 100, multiple base station (BS) 270, base station controller (BSC) 275 and mobile switching centre (MSC) 280.MSC280 is constructed to form interface with Public Switched Telephony Network (PSTN) 290.MSC280 is also constructed to form interface with the BSC275 that can be couple to base station 270 via back haul link.Back haul link can construct according to any one in some interfaces that oneself knows, described interface comprises such as E1/T1, ATM, IP, PPP, frame relay, HDSL, ADSL or xDSL.Will be appreciated that device as shown in Figure 2 can comprise multiple BSC2750.
Each BS270 can serve one or more subregion (or region), by multidirectional antenna or point to specific direction each subregion of antenna cover radially away from BS270.Or each subregion can by two or more antenna covers for diversity reception.Each BS270 can be constructed to support multiple parallel compensate, and each parallel compensate has specific frequency spectrum (such as, 1.25MHz, 5MHz etc.).
Subregion can be called as CDMA Channel with intersecting of parallel compensate.BS270 also can be called as the sub-device of base station transceiver (BTS) or other equivalent terms.Under these circumstances, term " base station " may be used for broadly representing single BSC275 and at least one BS270.Base station also can be called as " cellular station ".Or each subregion of particular B S270 can be called as multiple cellular station.
As shown in Figure 2, broadcast singal is sent to the mobile terminal 100 operated in device by broadcsting transmitter (BT) 295.Broadcast reception module 111 as shown in Figure 1 is arranged on mobile terminal 100 and sentences the broadcast singal receiving and sent by BT295.In fig. 2, several global pick device (GPS) satellite 300 is shown.Satellite 300 helps at least one in the multiple mobile terminal 100 in location.
In fig. 2, depict multiple satellite 300, but be understandable that, the satellite of any number can be utilized to obtain useful locating information.GPS module 115 as shown in Figure 1 is constructed to coordinate to obtain the locating information wanted with satellite 300 usually.Substitute GPS tracking technique or outside GPS tracking technique, can use can other technology of position of tracking mobile terminal.In addition, at least one gps satellite 300 optionally or extraly can process satellite dmb transmission.
As a typical operation of radio communication device, BS270 receives the reverse link signal from various mobile terminal 100.Mobile terminal 100 participates in call usually, information receiving and transmitting communicates with other type.Each reverse link signal that certain base station 270 receives is processed by particular B S270.The data obtained are forwarded to relevant BSC275.BSC provides call Resourse Distribute and comprises the mobile management function of coordination of the soft switching process between BS270.The data received also are routed to MSC280 by BSC275, and it is provided for the extra route service forming interface with PSTN290.Similarly, PSTN290 and MSC280 forms interface, and MSC and BSC275 forms interface, and BSC275 correspondingly control BS270 so that forward link signals is sent to mobile terminal 100.
Based on the structure of above-mentioned mobile terminal hardware configuration, communicator, each embodiment of memory leak detecting device of the present invention is proposed.
With reference to the structural representation that Fig. 3, Fig. 3 are the first embodiment of memory leak detecting device of the present invention, this device comprises:
Acquisition module 10, for gathering the internal memory sample information of tested process, described internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to described sampling time;
Generation module 11, for generating the variation tendency of the EMS memory occupation value of described tested process;
Detection module 12, for the variation tendency of the EMS memory occupation value according to described tested process, judges whether described tested process exists RAM leakage.
The terminal at this tested process place can be smart mobile phone, panel computer etc., and the operating system of the terminal at this tested process place can be Android system, in the present invention, for the terminal at this tested process place for Android mobile phone.
This tested process can have one or more, and process as tested in this is one or more in the processes such as micro-letter application process, microblogging application process, browser application process.
This tested process is when normally running, user performs various operation by this tested process, as when this tested process is micro-letter application process, user is undertaken chatting (voice-enabled chat, text chat, Video chat), sending out circle of friends, establishment/deletion contact person etc. by this micro-letter application process.
This acquisition module 10 gathers the internal memory sample information of tested process, concrete, according to the internal memory sample information of the tested process of prefixed time interval timing acquiring, as gathered the internal memory sample information of primary measured process every ten seconds, then can obtain 60 internal memory sample information in ten minutes.
In one embodiment, this tested process only has one, process as tested in this is micro-letter application process, then this acquisition module 10 gathers the internal memory sample information of this micro-letter application process, as gathered once the internal memory sample information of the process of micro-letter every ten seconds, then in ten minutes, obtain 60 internal memory sample information.
In another embodiment, this tested process has multiple, process as tested in this comprises micro-letter application process and microblogging application process, then this acquisition module 10 gathers multiple internal memory sampled datas of this micro-letter application process and microblogging application process respectively, as gathered once the internal memory sample information of micro-letter application process and microblogging application process every ten seconds, then in ten minutes, obtain 60 internal memory sample information of micro-letter application process and 60 internal memory sample information of microblogging application process respectively.
This internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to this sampling time, and namely this acquisition module 10 records sampling time and tested process in EMS memory occupation value corresponding to this sampling time; This EMS memory occupation value is the Prviatedirty value of TOTAL, as shown in Figure 4, represents that the internal memory situation that a tested process is at a time consumed, this EMS memory occupation value are 15624 (correspondence the 2nd arranges the numerical value of the 12nd row).
The EMS memory occupation value of the tested process that this generation module 11 gathers according to acquisition module 10 generates the variation tendency of the EMS memory occupation value of this tested process, process as tested in this is the application of micro-letter, when the EMS memory occupation value gathered has 60, then in XY coordinate axis, X value represents sampled point numbering (as 1,2,3,4......, 59,60) or sampling time, Y value represents sampled point numbering or EMS memory occupation value corresponding to sampling time.Optionally, by the variation tendency of the EMS memory occupation value of the tested process of histogram graph representation in XY coordinate, as shown in Figure 5, X-axis represents that the sampling time, (1 in X-axis represented the 1st second, 8 represent the 8th second, and 15 represent the 15th second, the like, 204 represent the 204th second), Y-axis represents EMS memory occupation value (unit is KB).Optionally, in XY coordinate, the variation tendency of the EMS memory occupation value of tested process is represented by broken line graph.
When tested process only has one, then this generation module 11 generates the variation tendency of the EMS memory occupation value of a tested process, and process as tested in this is micro-letter application process, then only generate the variation tendency of the EMS memory occupation value of this micro-letter application process; When this tested process has multiple, then this generation module 11 generates the variation tendency of the EMS memory occupation value of each tested process respectively, process as tested in this is micro-letter application process and microblogging application process, then generate the variation tendency of the EMS memory occupation value of this micro-letter application process and microblogging application process respectively.
This generation module 11 can be arranged on the terminal at this tested process place, in another terminal outside the terminal that also can be arranged on this tested process place, the terminal at process place as tested in this is Android mobile phone, then this generation module 11 can be arranged in this Android mobile phone, also can be arranged on panel computer.
Common, when tested process generation RAM leakage, the EMS memory occupation value of this tested process can become large, namely this tested process is after using certain internal memory distributed, and does not discharge in time, when needs internal memory, redistribute new internal memory, cause the EMS memory occupation value of this tested process to become large; Therefore, this detection module 12 by judging the variation tendency of the EMS memory occupation value of this tested process, can determine whether this tested process exists leakage.Adopt above-described embodiment, memory leak detecting device comprises: acquisition module 10, and for gathering the internal memory sample information of tested process, this internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to this sampling time; Generation module 11, for generating the variation tendency of the EMS memory occupation value of this tested process; Detection module 12, for the variation tendency of the EMS memory occupation value according to this tested process, judges whether this tested process exists RAM leakage.Can judge whether tested process RAM leakage occurs according to the internal memory sample information of this collection, the accuracy of memory leak detecting can be improved.
Further, this detection module 12 also for, when the variation tendency of the EMS memory occupation value of this tested process is increasing trend, judge that this tested process exists RAM leakage, otherwise, judge that this tested process does not exist RAM leakage.
This detection module 12 judges whether the variation tendency of the EMS memory occupation value of this tested process is increasing trend, concrete, when the EMS memory occupation value of this tested process is in increase always, then think that the variation tendency of EMS memory occupation value of this tested process is increasing trend, when the EMS memory occupation value of this tested process increases, reduces for a moment for a moment, but the amplitude increased is far longer than the amplitude of reduction, then think that the variation tendency of EMS memory occupation value of tested process is increasing trend.
When acquiring multiple internal memory sample information of this tested process at multiple Preset Time, then this detection module 12 analyzes sub-variation tendency corresponding to the EMS memory occupation value of multiple internal memory sample information of this tested process that each Preset Time gathers respectively, the variation tendency of the EMS memory occupation value of this tested process is determined again according to the sub-variation tendency of EMS memory occupation value in each Preset Time of this tested process, when to be greater than sub-variation tendency be the number of times of non-increasing trend (decline trend or moderate tone) to the number of times that this sub-variation tendency is increasing trend, think that the variation tendency of EMS memory occupation value of this tested process is increasing trend.As in one embodiment, this tested process is micro-letter application process, this Preset Time is ten minutes, by micro-letter application process, the collection that five durations are ten minutes has been carried out to this, as assigned to 10: 10 the multiple internal memory sample information acquiring micro-letter application process for 10: 20, (each sampling interval was ten seconds, then sampling obtains 60 internal memory sample information), (each sampling interval was ten seconds to assign to 10: 30 the multiple internal memory sample information gathering micro-letter application process for 10: 40, then sampling obtains 60 internal memory sample information), (each sampling interval was ten seconds to assign to 10: 50 the multiple internal memory sample information gathering micro-letter application process 11 o'clock sharps, then sampling obtains 60 internal memory sample information), (each sampling interval was ten seconds to gather multiple internal memory sample information of micro-letter application process in 11 o'clock sharps by 11: 10, then sampling obtains 60 internal memory sample information), (each sampling interval was ten seconds to assign to 11: 10 the multiple internal memory sample information gathering micro-letter application process for 11: 20, then sampling obtains 60 internal memory sample information), analyze the sub-variation tendency of EMS memory occupation value in these 5 time periods of this micro-letter application process respectively, the EMS memory occupation value of letter application process as micro-in this is increasing trend in the 10: 10 sub-variation tendencies assigned in the time period of 10: 20, the EMS memory occupation value of this micro-letter application process is increasing trend in the 10: 30 sub-variation tendencies assigned in the time period of 10: 40, the EMS memory occupation value of this micro-letter application process is non-increasing trend in the sub-variation tendency that 10: 50 assigned in the time period of 11 o'clock sharps, the sub-variation tendency of EMS memory occupation value within the time period of 11 o'clock sharps by 11: 10 of this micro-letter application process is non-increasing trend, the EMS memory occupation value of this micro-letter application process is increasing trend in the 11: 10 sub-variation tendencies assigned in the time period of 11: 20, then think that the variation tendency of EMS memory occupation value of micro-letter application process is increasing trend.
With reference to the structural representation that Fig. 6, Fig. 6 are the second embodiment of memory leak detecting device of the present invention.
Based on the first embodiment of above-mentioned memory leak detecting device, this device also comprises: acquisition module 13, and for obtaining test script, this test script is shell script;
This acquisition module 10, also gathers the internal memory sample information of tested process for running shell script.
This acquisition module 13 can directly read from the storer of the terminal at this tested process place, also the other-end by carrying out wired connection or wireless connections with the terminal at this tested process place obtains test script, in one embodiment, the terminal at process place as tested in this is Android mobile phone, the terminal be connected with this Android mobile phone is panel computer, this panel computer is preserved the test script for carrying out memory leak detecting, this acquisition module 13 obtains test script from this panel computer, and this test script is kept at (as being kept in the SD card of Android mobile phone) in Android mobile phone, in another embodiment, this acquisition module 13 read test script from the SD card of the terminal at this tested process place.
This test script is shell script, and this test script operates in the bottom of the terminal at this tested process place.The bottom of the terminal at this tested process place is operated in due to this shell script, therefore the internal memory sample information of tested program is collected accurately by this shell script, concrete, acquisition module 10, gathers the internal memory sample information of tested process for running shell script.
With reference to the structural representation that Fig. 7, Fig. 7 are the 3rd embodiment of memory leak detecting device of the present invention.
Based on the first embodiment or second embodiment of above-mentioned memory leak detecting device, this device also comprises:
Locating module 14, for when this tested process exists RAM leakage, locates object or the code segment of this tested process generation RAM leakage according to the variation tendency of the EMS memory occupation value of this tested process.
When there is RAM leakage in this tested process, likely just because a certain partial code section of this tested process or object operationally cause RAM leakage, object or the code segment of this tested process generation RAM leakage is located according to the variation tendency of the EMS memory occupation value of tested process at this locating module 14, as, from the variation tendency of the EMS memory occupation value of this tested process, find EMS memory occupation value to be in the time point increased progressively, find when this time point again, user has carried out some what operations, and then find corresponding object or code segment, namely object or code segment that RAM leakage occurs is found, the schematic diagram of the variation tendency of the EMS memory occupation value of certain tested process as shown in fig. 5, the EMS memory occupation value gathered at the 169th second to the 190th second obviously increases, and increase after EMS memory occupation value all larger than the EMS memory occupation value gathered before, therefore can think and there occurs RAM leakage when within the 169th second to the 190th second, running tested process, search the 169th second to the 190th second time, user has carried out some what operations, and then find corresponding object or code segment, object or code segment that RAM leakage occurs are positioned.
With reference to the structural representation that Fig. 8, Fig. 8 are the 4th embodiment of memory leak detecting device of the present invention, this device also comprises:
Sending module 21, internal memory sample information for the tested process by described collection sends to monitor terminal, with the variation tendency making described monitor terminal generate the EMS memory occupation value of described tested process, and the variation tendency of EMS memory occupation value according to described tested process, judge whether described tested process exists RAM leakage.
The terminal at this tested process place with set up wired or wireless connection between monitor terminal, as in one embodiment, the terminal at this tested process place is Android mobile phone, this monitor terminal is panel computer, this Android mobile phone is connected by USB data line with this panel computer, or this Android mobile phone is connected by wireless communication technique with this panel computer.
Multiple internal memory sample information of the tested process gathered can be sent to monitor terminal with journal file form by this sending module 21, monitor terminal is after receiving multiple internal memory sample information of tested process, analyze, to determine whether this tested process exists RAM leakage, concrete, first this monitor terminal generates the variation tendency of the EMS memory occupation value of this tested process, then according to the variation tendency of the EMS memory occupation value of this tested process, judges whether this tested process exists RAM leakage.
The present invention further provides a kind of method for detecting memory leakage.
With reference to the schematic flow sheet that Fig. 9, Fig. 9 are the first embodiment of method for detecting memory leakage of the present invention, the method comprises:
S10, gather the internal memory sample information of tested process, described internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to described sampling time.
The terminal at tested process place can be smart mobile phone, panel computer etc., and the operating system of the terminal at this tested process place can be Android system, in the present invention, for the terminal at this tested process place for Android mobile phone.
This tested process can have one or more, and process as tested in this is one or more in the application such as micro-letter application process, microblogging application process, browser application process.
This tested process is when normally running, user performs various operation by this tested process, as when this tested process is micro-letter application process, user is undertaken chatting (voice-enabled chat, text chat, Video chat), sending out circle of friends, establishment/deletion contact person etc. by this micro-letter application process.
In this step, gather the internal memory sample information of tested process, concrete, can according to multiple internal memory sample information of the tested process of prefixed time interval timing acquiring, as gathered the internal memory sample information of primary measured process every ten seconds, then in ten minutes, obtain 60 internal memory sample information.
In one embodiment, this tested process only has one, process as tested in this is micro-letter application process, in this step, gather the internal memory sample information of this micro-letter application process, as gathered once the internal memory sample information of micro-letter application process every ten seconds, then in ten minutes, obtain 60 internal memory sample information.
In another embodiment, this tested process has multiple, process as tested in this comprises micro-letter application process and microblogging application process, then in this step, gather multiple internal memory sampled datas of this micro-letter application process and microblogging application process respectively, as gathered once the internal memory sample information of micro-letter application process and microblogging application process every ten seconds, then in ten minutes, obtain 60 internal memory sample information of micro-letter application process and 60 internal memory sample information of microblogging application process respectively.
This internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to this sampling time, and namely in this step, record sampling time and tested process are in EMS memory occupation value corresponding to this sampling time; This EMS memory occupation value is the Prviatedirty value of TOTAL, as shown in Figure 4, represents that the internal memory situation that a tested process is at a time consumed, this EMS memory occupation value are 15624 (correspondence the 2nd arranges the numerical value of the 12nd row).
S11, generate the variation tendency of the EMS memory occupation value of this tested process.
The variation tendency of the EMS memory occupation value of this tested process is generated according to the EMS memory occupation value of the tested process gathered in step slo, process as tested in this is micro-letter application process, when the EMS memory occupation value gathered has 60, then in XY coordinate axis, X value represents sampled point numbering (as 1,2,3,4......, 59,60) or sampling time, Y value represents sampled point numbering or EMS memory occupation value corresponding to sampling time.Optionally, by the variation tendency of the EMS memory occupation value of the tested process of histogram graph representation in XY coordinate, as shown in Figure 5, X-axis represents that the sampling time, (1 in X-axis represented the 1st second, 8 represent the 8th second, and 15 represent the 15th second, the like, 204 represent the 204th second), Y-axis represents EMS memory occupation value (unit is KB).Optionally, in XY coordinate, the variation tendency of the EMS memory occupation value of tested process is represented by broken line graph.
When tested process only has one, then generate the variation tendency of the EMS memory occupation value of a tested process, process as tested in this is micro-letter application process, then only generate the variation tendency of the EMS memory occupation value of this micro-letter application process; When this tested process has multiple, then generate the variation tendency of the EMS memory occupation value of each tested process respectively, process as tested in this is micro-letter application process and microblogging application process, then generate the variation tendency of the EMS memory occupation value of this micro-letter application process and microblogging application process respectively.
This step S11 can the terminal at this tested process place perform, also can another terminal outside the terminal at this tested process place perform, the terminal at process place as tested in this is Android mobile phone, then this step S11 can perform in this Android mobile phone, also can perform on panel computer.
S12, variation tendency according to the EMS memory occupation value of this tested process, judge whether this tested process exists RAM leakage.
Common, when tested process generation RAM leakage, the EMS memory occupation value of this tested process can become large, namely this tested process is after using certain internal memory distributed, and does not discharge in time, when needs internal memory, redistribute new internal memory, cause the EMS memory occupation value of this tested process to become large; Therefore, in this step, by judging the variation tendency of the EMS memory occupation value of this tested process, can determine whether this tested process exists leakage.
Adopt above-described embodiment, gather the internal memory sample information of tested process, this internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to this sampling time; Generate the variation tendency of the EMS memory occupation value of this tested process; According to the variation tendency of the EMS memory occupation value of this tested process, judge whether this tested process exists RAM leakage; Tested process can judge whether tested process RAM leakage occurs according to the internal memory sample information of this collection, the accuracy of memory leak detecting can be improved.
Further, according to the variation tendency of the EMS memory occupation value of this tested process, judge that the step whether this tested process exists RAM leakage comprises:
If the variation tendency of the EMS memory occupation value of this tested process is increasing trend, then judge that this tested process exists RAM leakage, otherwise, judge that this tested process does not exist RAM leakage.
In this step, whether the variation tendency judging the EMS memory occupation value of this tested process is increasing trend, concrete, when the EMS memory occupation value of this tested process is in increase always, then think that the variation tendency of EMS memory occupation value of this tested process is increasing trend, when the EMS memory occupation value of this tested process increases, reduces for a moment for a moment, but the amplitude increased is far longer than the amplitude of reduction, then think that the variation tendency of EMS memory occupation value of tested process is increasing trend.
When acquiring multiple internal memory sample information of this tested process at multiple Preset Time, then analyze the sub-variation tendency that the EMS memory occupation value of multiple internal memory sample information of this tested process that each Preset Time gathers is corresponding respectively, the variation tendency of the EMS memory occupation value of this tested process is determined again according to the sub-variation tendency of EMS memory occupation value in each Preset Time of this tested process, when to be greater than sub-variation tendency be the number of times of non-increasing trend (decline trend or moderate tone) to the number of times that this sub-variation tendency is increasing trend, think that the variation tendency of EMS memory occupation value of this tested process is increasing trend.As in one embodiment, this tested process is micro-letter application process, this Preset Time is ten minutes, by micro-letter application process, the collection that five durations are ten minutes has been carried out to this, as assigned to 10: 10 the multiple internal memory sample information acquiring micro-letter application process for 10: 20, (each sampling interval was ten seconds, then sampling obtains 60 internal memory sample information), (each sampling interval was ten seconds to assign to 10: 30 the multiple internal memory sample information gathering micro-letter application process for 10: 40, then sampling obtains 60 internal memory sample information), (each sampling interval was ten seconds to assign to 10: 50 the multiple internal memory sample information gathering micro-letter application process 11 o'clock sharps, then sampling obtains 60 internal memory sample information), (each sampling interval was ten seconds to gather multiple internal memory sample information of micro-letter application process in 11 o'clock sharps by 11: 10, then sampling obtains 60 internal memory sample information), (each sampling interval was ten seconds to assign to 11: 10 the multiple internal memory sample information gathering micro-letter application process for 11: 20, then sampling obtains 60 internal memory sample information), analyze the sub-variation tendency of EMS memory occupation value in these 5 time periods of this micro-letter application process respectively, the EMS memory occupation value of letter application process as micro-in this is increasing trend in the 10: 10 sub-variation tendencies assigned in the time period of 10: 20, the EMS memory occupation value of this micro-letter application process is increasing trend in the 10: 30 sub-variation tendencies assigned in the time period of 10: 40, the EMS memory occupation value of this micro-letter application process is non-increasing trend in the sub-variation tendency that 10: 50 assigned in the time period of 11 o'clock sharps, the sub-variation tendency of EMS memory occupation value within the time period of 11 o'clock sharps by 11: 10 of this micro-letter application process is non-increasing trend, the EMS memory occupation value of this micro-letter application process is increasing trend in the 11: 10 sub-variation tendencies assigned in the time period of 11: 20, then think that the variation tendency of EMS memory occupation value of micro-letter application process is increasing trend.
With reference to the schematic flow sheet that Figure 10, Figure 10 are the second embodiment of method for detecting memory leakage of the present invention.
Based on the first embodiment of above-mentioned method for detecting memory leakage, the method also comprises: S13, acquisition test script, and this test script is shell script;
The step of the internal memory sample information of the tested process of this collection is: run the internal memory sample information that shell script gathers tested process.
In this step S13, can directly read from the storer of the terminal at this tested process place, also the other-end by carrying out wired connection or wireless connections with the terminal at this tested process place obtains test script, the terminal at process place as tested in this is Android mobile phone, the terminal be connected with this Android mobile phone is panel computer, this panel computer is preserved the test script for carrying out memory leak detecting, then from this panel computer, obtain test script, and this test script is kept at (as being kept in the SD card of Android mobile phone) in Android mobile phone; In another embodiment, in this step S13 from the SD card of the terminal at this tested process place read test script.
This test script is shell script, and this test script operates in the bottom of the terminal at this tested process place.Operate in the bottom of the terminal at this tested process place due to this shell script, therefore collect the internal memory sample information of tested program by this shell script accurately.
With reference to the schematic flow sheet that Figure 11, Figure 11 are the 3rd embodiment of method for detecting memory leakage of the present invention.
Based on the first embodiment or second embodiment of above-mentioned method for detecting memory leakage, the method also comprises:
S14, when this tested process exists RAM leakage, locate object or the code segment of this tested process generation RAM leakage according to the variation tendency of the EMS memory occupation value of this tested process.
When there is RAM leakage in this tested process, likely just because a certain partial code section of this tested process or object operationally cause RAM leakage, in this step, object or the code segment of this tested process generation RAM leakage is located according to the variation tendency of the EMS memory occupation value of tested process, as, from the variation tendency of the EMS memory occupation value of this tested process, find EMS memory occupation value to be in the time point increased progressively, find when this time point again, user has carried out some what operations, and then find corresponding object or code segment, namely object or code segment that RAM leakage occurs is found, the schematic diagram of the variation tendency of the EMS memory occupation value of certain tested process as shown in fig. 5, the EMS memory occupation value gathered at the 169th second to the 190th second obviously increases, and increase after EMS memory occupation value all larger than the EMS memory occupation value gathered before, therefore can think and there occurs RAM leakage when within the 169th second to the 190th second, running tested process, search the 169th second to the 190th second time, user has carried out some what operations, and then find corresponding object or code segment, object or code segment that RAM leakage occurs are positioned.
Based on the first embodiment or second embodiment of above-mentioned method for detecting memory leakage, the method also comprises:
The internal memory sample information of the tested process of described collection is sent to monitor terminal, with the variation tendency making described monitor terminal generate the EMS memory occupation value of described tested process, and the variation tendency of EMS memory occupation value according to described tested process, judge whether described tested process exists RAM leakage.
The terminal at this tested process place with set up wired or wireless connection between monitor terminal, as in one embodiment, the terminal at this tested process place is Android mobile phone, this monitor terminal is panel computer, this Android mobile phone is connected by USB data line with this panel computer, or this Android mobile phone is connected by wireless communication technique with this panel computer.
In this step, multiple internal memory sample information of the tested process gathered can be sent to monitor terminal with journal file form, monitor terminal is after receiving multiple internal memory sample information of tested process, analyze, to determine whether this tested process exists RAM leakage, concrete, first this monitor terminal generates the variation tendency of the EMS memory occupation value of this tested process, then according to the variation tendency of the EMS memory occupation value of this tested process, judge whether this tested process exists RAM leakage.
Further, the present invention also provides a kind of terminal, this terminal comprise that above-mentioned any embodiment provides memory leak detecting device.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that above-described embodiment method can add required general hardware platform by software and realize, hardware can certainly be passed through, but in a lot of situation, the former is better embodiment.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in a storage medium (as ROM/RAM, magnetic disc, CD), comprising some instructions in order to make a station terminal equipment (can be mobile phone, computing machine, server, air conditioner, or the network equipment etc.) perform the method that each embodiment of the present invention is somebody's turn to do.
These are only the preferred embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every utilize instructions of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.

Claims (10)

1. a memory leak detecting device, is characterized in that, this device comprises:
Acquisition module, for gathering the internal memory sample information of tested process, described internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to described sampling time;
Generation module, for generating the variation tendency of the EMS memory occupation value of described tested process;
Detection module, for the variation tendency of the EMS memory occupation value according to described tested process, judges whether described tested process exists RAM leakage.
2. memory leak detecting device as claimed in claim 1, it is characterized in that, described detection module also for, when the variation tendency of the EMS memory occupation value of described tested process is increasing trend, judge that described tested process exists RAM leakage, otherwise, judge that described tested process does not exist RAM leakage.
3. memory leak detecting device as claimed in claim 1 or 2, it is characterized in that, described device also comprises: acquisition module, and for obtaining test script, described test script is shell script;
Described acquisition module, also gathers the internal memory sample information of tested process for running shell script.
4. memory leak detecting device as claimed in claim 1 or 2, it is characterized in that, described device also comprises:
Locating module, for when described tested process exists RAM leakage, locates object or the code segment of tested process generation RAM leakage according to the variation tendency of the EMS memory occupation value of described tested process.
5. memory leak detecting device as claimed in claim 1 or 2, it is characterized in that, described device also comprises:
Sending module, internal memory sample information for the tested process by described collection sends to monitor terminal, with the variation tendency making described monitor terminal generate the EMS memory occupation value of described tested process, and the variation tendency of EMS memory occupation value according to described tested process, judge whether described tested process exists RAM leakage.
6. a method for detecting memory leakage, is characterized in that, the method comprises:
Gather the internal memory sample information of tested process, described internal memory sample information comprises sampling time, tested process in EMS memory occupation value corresponding to described sampling time;
Generate the variation tendency of the EMS memory occupation value of described tested process;
According to the variation tendency of the EMS memory occupation value of described tested process, judge whether described tested process exists RAM leakage.
7. method for detecting memory leakage as claimed in claim 6, is characterized in that the variation tendency of the described EMS memory occupation value according to described tested process judges that the step whether described tested process exists RAM leakage comprises:
If the variation tendency of the EMS memory occupation value of described tested process is increasing trend, then judge that described tested process exists RAM leakage, otherwise, judge that described tested process does not exist RAM leakage.
8. method for detecting memory leakage as claimed in claims 6 or 7, it is characterized in that, the variation tendency of the described EMS memory occupation value according to described tested process, after judging whether described tested process exists the step of RAM leakage, the method also comprises:
When described tested process exists RAM leakage, according to object or the code segment of the described tested process generation RAM leakage in variation tendency location of the EMS memory occupation value of described tested process.
9. method for detecting memory leakage as claimed in claims 6 or 7, it is characterized in that, the internal memory sample information of the tested process of described collection, described internal memory sample information comprises sampling time, tested process after the step of EMS memory occupation value corresponding to described sampling time, and the method also comprises:
The internal memory sample information of the tested process of described collection is sent to monitor terminal, with the variation tendency making described monitor terminal generate the EMS memory occupation value of described tested process, and the variation tendency of EMS memory occupation value according to described tested process, judge whether described tested process exists RAM leakage.
10. a terminal, is characterized in that, described terminal comprises the memory leak detecting device as described in any one of claim 1-5.
CN201510615560.2A 2015-09-24 2015-09-24 Memory leak detection device and method and terminal Pending CN105204996A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510615560.2A CN105204996A (en) 2015-09-24 2015-09-24 Memory leak detection device and method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510615560.2A CN105204996A (en) 2015-09-24 2015-09-24 Memory leak detection device and method and terminal

Publications (1)

Publication Number Publication Date
CN105204996A true CN105204996A (en) 2015-12-30

Family

ID=54952690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510615560.2A Pending CN105204996A (en) 2015-09-24 2015-09-24 Memory leak detection device and method and terminal

Country Status (1)

Country Link
CN (1) CN105204996A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106227650A (en) * 2016-07-08 2016-12-14 北京奇虎科技有限公司 A kind of method and apparatus of the memory overflow detecting application
CN106354627A (en) * 2016-07-21 2017-01-25 努比亚技术有限公司 Method and system for detecting memory leakage of application program
CN106649105A (en) * 2016-12-08 2017-05-10 武汉斗鱼网络科技有限公司 Detection methods and devices for memory leaks
CN107346266A (en) * 2017-06-09 2017-11-14 烽火通信科技股份有限公司 Memory Allocation information tracking method and device based on vxworks operating system
CN107346285A (en) * 2017-05-26 2017-11-14 郑州云海信息技术有限公司 A kind of method for detecting memory leakage and device
CN108377292A (en) * 2018-01-30 2018-08-07 努比亚技术有限公司 Solve method, terminal, server and the computer storage media of RAM leakage
CN108536586A (en) * 2018-03-20 2018-09-14 中国工商银行股份有限公司 Information acquisition method, equipment and the system of Android mobile terminal
CN109213659A (en) * 2018-11-01 2019-01-15 郑州云海信息技术有限公司 A kind of monitoring method, device and the storage medium of device memory state
CN109376129A (en) * 2018-10-08 2019-02-22 郑州云海信息技术有限公司 A method of storage log is collected when locking by SYS_TF automatically
CN109491897A (en) * 2018-10-26 2019-03-19 成都安恒信息技术有限公司 A kind of system resource leak testing method based on trend analysis
CN110134611A (en) * 2019-05-20 2019-08-16 腾讯科技(深圳)有限公司 Memory overflow analysis method, device, terminal and storage medium
CN110941549A (en) * 2019-11-19 2020-03-31 北京字节跳动网络技术有限公司 Memory leak detection method, device, medium and electronic equipment
CN111356987A (en) * 2017-09-18 2020-06-30 深圳传音通讯有限公司 Dynamic memory identification method and device
CN112346894A (en) * 2019-08-09 2021-02-09 腾讯科技(深圳)有限公司 Memory leak detection method, device and system and computer equipment
CN113434364A (en) * 2021-06-25 2021-09-24 青岛海尔科技有限公司 Screen-side equipment memory detection method and device, storage medium and electronic device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060277440A1 (en) * 2005-06-02 2006-12-07 International Business Machines Corporation Method, system, and computer program product for light weight memory leak detection
CN101162436A (en) * 2006-10-13 2008-04-16 中兴通讯股份有限公司 Ems memory leakage testing method in communication apparatus system
CN103049376A (en) * 2012-12-10 2013-04-17 北京小米科技有限责任公司 Memory overflow test method, device and equipment of courses
CN103383659A (en) * 2013-07-11 2013-11-06 哈尔滨工程大学 Software accelerating life test method
CN103714004A (en) * 2014-01-02 2014-04-09 金蝶软件(中国)有限公司 JVM online memory leak analysis method and system
CN104317702A (en) * 2014-09-30 2015-01-28 广东欧珀移动通信有限公司 Method and device for automatic testing of memory of intelligent mobile terminal
CN104932970A (en) * 2015-05-29 2015-09-23 小米科技有限责任公司 Monitoring method and device of memory leakage

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060277440A1 (en) * 2005-06-02 2006-12-07 International Business Machines Corporation Method, system, and computer program product for light weight memory leak detection
CN101162436A (en) * 2006-10-13 2008-04-16 中兴通讯股份有限公司 Ems memory leakage testing method in communication apparatus system
CN103049376A (en) * 2012-12-10 2013-04-17 北京小米科技有限责任公司 Memory overflow test method, device and equipment of courses
CN103383659A (en) * 2013-07-11 2013-11-06 哈尔滨工程大学 Software accelerating life test method
CN103714004A (en) * 2014-01-02 2014-04-09 金蝶软件(中国)有限公司 JVM online memory leak analysis method and system
CN104317702A (en) * 2014-09-30 2015-01-28 广东欧珀移动通信有限公司 Method and device for automatic testing of memory of intelligent mobile terminal
CN104932970A (en) * 2015-05-29 2015-09-23 小米科技有限责任公司 Monitoring method and device of memory leakage

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106227650A (en) * 2016-07-08 2016-12-14 北京奇虎科技有限公司 A kind of method and apparatus of the memory overflow detecting application
CN106354627A (en) * 2016-07-21 2017-01-25 努比亚技术有限公司 Method and system for detecting memory leakage of application program
CN106649105B (en) * 2016-12-08 2019-06-04 武汉斗鱼网络科技有限公司 A kind of detection method and device of memory overflow
CN106649105A (en) * 2016-12-08 2017-05-10 武汉斗鱼网络科技有限公司 Detection methods and devices for memory leaks
CN107346285A (en) * 2017-05-26 2017-11-14 郑州云海信息技术有限公司 A kind of method for detecting memory leakage and device
CN107346266A (en) * 2017-06-09 2017-11-14 烽火通信科技股份有限公司 Memory Allocation information tracking method and device based on vxworks operating system
CN111356987A (en) * 2017-09-18 2020-06-30 深圳传音通讯有限公司 Dynamic memory identification method and device
CN108377292A (en) * 2018-01-30 2018-08-07 努比亚技术有限公司 Solve method, terminal, server and the computer storage media of RAM leakage
CN108536586B (en) * 2018-03-20 2021-08-27 中国工商银行股份有限公司 Information acquisition method, equipment and system of Android mobile terminal
CN108536586A (en) * 2018-03-20 2018-09-14 中国工商银行股份有限公司 Information acquisition method, equipment and the system of Android mobile terminal
CN109376129A (en) * 2018-10-08 2019-02-22 郑州云海信息技术有限公司 A method of storage log is collected when locking by SYS_TF automatically
CN109491897A (en) * 2018-10-26 2019-03-19 成都安恒信息技术有限公司 A kind of system resource leak testing method based on trend analysis
CN109213659A (en) * 2018-11-01 2019-01-15 郑州云海信息技术有限公司 A kind of monitoring method, device and the storage medium of device memory state
CN110134611B (en) * 2019-05-20 2021-06-25 腾讯科技(深圳)有限公司 Memory leak analysis method, device, terminal and storage medium
CN110134611A (en) * 2019-05-20 2019-08-16 腾讯科技(深圳)有限公司 Memory overflow analysis method, device, terminal and storage medium
CN112346894A (en) * 2019-08-09 2021-02-09 腾讯科技(深圳)有限公司 Memory leak detection method, device and system and computer equipment
CN112346894B (en) * 2019-08-09 2023-04-14 腾讯科技(深圳)有限公司 Memory leak detection method, device and system and computer equipment
CN110941549A (en) * 2019-11-19 2020-03-31 北京字节跳动网络技术有限公司 Memory leak detection method, device, medium and electronic equipment
CN110941549B (en) * 2019-11-19 2021-12-07 北京字节跳动网络技术有限公司 Memory leak detection method, device, medium and electronic equipment
CN113434364A (en) * 2021-06-25 2021-09-24 青岛海尔科技有限公司 Screen-side equipment memory detection method and device, storage medium and electronic device
CN113434364B (en) * 2021-06-25 2024-03-22 青岛海尔科技有限公司 Method and device for detecting memory of screen terminal equipment, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN105204996A (en) Memory leak detection device and method and terminal
CN104915141A (en) Method and device for previewing object information
CN104899062A (en) Application booting method and apparatus
CN104883430A (en) Mobile terminal, processing method of unread superscripts of mobile terminal, and processing device of unread superscripts of mobile terminal
CN104750420A (en) Screen capturing method and device
CN105094643A (en) Page display control method and device
CN105093016A (en) Automation testing method and device for mobile terminal
CN105225457A (en) System, the apparatus and method of information prompting are carried out by intelligent home device
CN104991728A (en) Operation method and apparatus based on multi-functional key of mobile terminal
CN104808944A (en) Touch operation induction method and device
CN105302904A (en) Information pushing method and apparatus
CN104898961A (en) Application rapid starting method and apparatus
CN105187521A (en) Service processing device and method
CN105389110A (en) Fast touch apparatus and method
CN104954867A (en) Media playing method and device
CN104915140A (en) Processing method based on virtual key touch operation data and processing device based on virtual key touch operation data
CN104850443A (en) Method for shutting down false start-up application program and mobile terminal
CN104850799A (en) Mobile terminal and method of hiding data in mobile terminal
CN105306457A (en) Data caching device and method
CN105101264A (en) Method and device for monitoring state of terminal network
CN105094612A (en) Object selecting method and device
CN105204992A (en) Test script generating device and method
CN104915111A (en) Method and device for operating and controlling terminal
CN104881346A (en) Mobile terminal and detection method and device of power consumption of applications
CN104881218A (en) Mobile terminal screen scrolling method and mobile terminal screen scrolling device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 20151230