WO2019019713A1 - 检测应用程序内存泄露的方法、终端及可读存储介质 - Google Patents
检测应用程序内存泄露的方法、终端及可读存储介质 Download PDFInfo
- Publication number
- WO2019019713A1 WO2019019713A1 PCT/CN2018/083628 CN2018083628W WO2019019713A1 WO 2019019713 A1 WO2019019713 A1 WO 2019019713A1 CN 2018083628 W CN2018083628 W CN 2018083628W WO 2019019713 A1 WO2019019713 A1 WO 2019019713A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- page
- application
- memory leak
- detecting
- display state
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/362—Software debugging
- G06F11/3636—Software debugging by tracing the execution of the program
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/362—Software debugging
- G06F11/366—Software debugging using diagnostics
Definitions
- the present application relates to the field of testing technologies, and in particular, to a method, a terminal, and a computer readable storage medium for detecting application memory leaks.
- the application needs to be tested to detect the existence of memory leaks.
- the existing method for detecting memory leaks is cumbersome.
- the auxiliary tool the name of the tool is Xcode
- the development tool the tool name is instrument
- the embodiment of the present application provides a method, a terminal, and a computer readable storage medium for detecting an application memory leak, which can quickly detect whether a page of an application has a memory leak, and improve the efficiency of detecting a memory leak.
- an embodiment of the present application provides a method for detecting an application memory leak, the method comprising:
- hook technology is used to add processing logic to the application's page lifecycle method, and processing logic is added to the singleton instance to detect if there is a memory leak in the application's page.
- the embodiment of the present application provides a terminal, where the terminal includes:
- the determining unit is configured to: if receiving an instruction to detect an application memory leak, determine whether the application meets a preset condition for detecting a memory leak;
- the detecting unit is configured to: when the application meets the preset condition for detecting a memory leak, use hook technology to add processing logic to the page lifecycle method of the application, and add processing logic to the single instance to detect whether the page of the application is There is a memory leak.
- an embodiment of the present application provides another terminal, where the terminal includes: a memory and a processor; the memory stores executable program data; and the processor is configured to run the program stored in the memory. Data to perform the method described in the first aspect above.
- embodiments of the present application provide a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors To achieve the method described in the first aspect above.
- the embodiment of the present application can quickly detect whether a page of an application has a memory leak, and improve the efficiency of detecting a memory leak.
- FIG. 1 is a schematic flowchart of a method for detecting an application memory leak according to an embodiment of the present application
- FIG. 2 is a schematic diagram of a sub-flow of a method for detecting an application memory leak according to an embodiment of the present application
- FIG. 3 is a schematic diagram of a sub-flow of a method for detecting an application memory leak according to an embodiment of the present application
- FIG. 4 is a schematic diagram of a sub-flow provided by the embodiment of FIG. 3;
- FIG. 5 is a schematic block diagram of a terminal according to an embodiment of the present disclosure.
- FIG. 6 is a schematic block diagram of a determining unit provided by an embodiment of the present application.
- FIG. 7 is a schematic block diagram of a detecting unit provided by an embodiment of the present application.
- FIG. 8 is a schematic block diagram of a leak detecting unit provided by an embodiment of the present application.
- FIG. 9 is a schematic block diagram of another terminal provided by an embodiment of the present application.
- the terminal described in the embodiment of the present application includes, but is not limited to, other portable terminals such as a mobile phone, a laptop computer or a tablet computer that can install and run an application. It should also be understood that in some embodiments, the terminal is not a portable communication terminal, but also includes a desktop computer or the like that can install and run an application. Preferably, the embodiment of the present application is applied to a terminal developed by an IOS.
- FIG. 1 is a schematic flowchart of a method for detecting an application memory leak according to an embodiment of the present application.
- the method includes S101 to S102.
- S101 If an instruction for detecting an application memory leak is received, determine whether the application meets a preset condition for detecting a memory leak. Specifically, as shown in FIG. 2, S101 includes S201-S204. S201: If an instruction for detecting an application memory leak is received, detecting whether the application is a test version. If the application is detected as a test version by the identifier of the application, the identifier of the application may include 1 and 0, where 1 is represented as a test version and 0 is not a test version. The test version defaults to detecting that the memory leak is open. S202. If the application is a test version, determine that a preset condition for detecting a memory leak is met. S203.
- the application is a non-test version, obtain a configuration file of the application.
- This scenario includes that the person concerned is not at the terminal where the application is located, such as the terminal of the application at the company and the relevant person at home.
- the configuration file of the application is obtained by the terminal where the remote login application is located. Because of the limitation of remote login permission, security is further ensured to prevent non-related personnel from remotely logging in.
- S204. Determine, according to a parameter for detecting a memory leak in the configuration file, whether a preset condition for detecting a memory leak is met.
- the parameter for detecting the memory leak includes a switch for detecting a memory leak.
- the switch for detecting the memory leak in the configuration file is turned on, it is determined that the preset condition for detecting the memory leak is met, and the memory leak can be detected; if the memory leak is detected in the configuration file The switch is turned off, and it is determined that the preset condition for detecting the memory leak is not satisfied, and the memory leak cannot be detected.
- relevant personnel can detect memory leaks anytime, anywhere.
- the hook technology is used to add processing logic to the application page lifecycle method, and the processing logic is added to the single instance to detect whether the application page has memory.
- the hook also known as hook, is a platform of the WindoWs message processing mechanism.
- the application can set a subroutine to monitor a certain message of the specified window, and the monitored window can be created by other processes. When the message arrives, it is processed before the target window handler.
- the hook mechanism allows the application to intercept processing windoW messages or specific events.
- the hook technology can be used to change the processing logic of the page life cycle method execution and the order of the code involved in the original method.
- the page life cycle method can execute the added processing logic first, and then execute the code logic involved in the original method.
- a singleton instance can be understood as a thread of the application management background, which is an instance of a singleton class. This singleton instance persists after the application is launched. It should be noted that adding processing logic to a singleton instance does not require the use of hook technology because the singleton instance is always running. If you can detect application memory leaks, use hook technology to add processing logic to the application's page lifecycle method, and add processing logic to the singleton instance to detect if there is a memory leak in the application's page.
- the application's page lifecycle methods include the method that the page will display, the method that the page will disappear, and the method of page destruction.
- the method that the page is to display refers to the method that is executed when the page is to be displayed.
- the method that the page will disappear refers to the method that is executed when the page is about to disappear, and the method of the page destruction refers to the method that is executed after the page is destroyed. method.
- the order in which the three methods are executed is the method that the page will display, the method that the page will disappear, and the method of page destruction. It should be noted that the page lifecycle method also involves other methods, which are not listed here. Specifically, as shown in FIG. 3, S102 includes S301-S305. S301.
- each page is set with a page identifier and display status.
- Each page has a unique page identifier, and the display status of the page includes that it will be displayed, will disappear, destroyed, and so on.
- the page identification and display status of each page is preferably saved on the stack. Since the stack data structure is last in, first out, the last opened page is first closed and destroyed, so that the order of closing the destroyed pages is the same as the order of stacking in the stack. On the one hand, it speeds up the destruction of the page, on the other hand, it is more accurate to which page has a memory leak. S302.
- the display status of the page is still in other states, such as The disappearing state, that is, the state that has not been destroyed, then the page still exists.
- the preset time is preferably 5 seconds. S305. If the page exists, determine and prompt that the page has a memory leak. Specifically, the page may be prompted to have a memory leak in the form of a dialog box. This solution can quickly locate pages with memory leaks in the application to allow interested parties to focus on pages with memory leaks.
- S304 includes S401-S403.
- S401 Determine whether the timer reaches a preset time. If the timer does not reach the preset time, then S401 is performed; if the timer reaches the preset time, S402 is performed. S402. If the timer reaches a preset time, obtain an identifier and a display state of the page. S403. Determine whether the page exists according to the identifier and the display status of the page. Specifically, the timer reaches the preset time. If the display state of the page is the destroyed state, the page does not exist; if the display state of the page is not the destroyed state, the page still exists. It can be understood that the page can be normally destroyed within a preset time. If the display state of the page is not the destroyed state after the preset time is reached, there may be a problem in the page, that is, there is a memory leak.
- the timer may also be set and started in the method in which the page disappears, because in the life cycle of the page, the method that the page will disappear first is executed, and then the method of disappearing the page is executed, so if the page disappears, Set and start the timer, then the corresponding preset time will be less than the preset time corresponding to setting and starting the timer in the method that the page is about to disappear.
- the above embodiment utilizes the hook technology to add processing logic to the application life cycle method, and adds processing logic to the single instance to detect whether there is a memory leak in the application page, and can quickly locate the application memory leaked page. Improve the efficiency of detecting memory leaks.
- FIG. 5 is a schematic block diagram of a terminal according to an embodiment of the present application.
- the terminal 50 includes a determining unit 501 and a detecting unit 502.
- the determining unit 501 is configured to determine whether the application meets a preset condition for detecting a memory leak if receiving an instruction to detect an application memory leak.
- the determination unit includes a test version detection unit 601, a detection determination unit 602, and a configuration acquisition unit 603.
- the test version detecting unit 601 is configured to detect whether the application is a test version if receiving an instruction to detect an application memory leak. If the application is detected as a test version by the identifier of the application, the identifier of the application may include 1 and 0, where 1 is represented as a test version and 0 is not a test version. The test version defaults to detecting that the memory leak is open.
- the detection determining unit 602 is configured to determine that a preset condition for detecting a memory leak is satisfied if the application is a test version.
- the configuration obtaining unit 603 is configured to acquire a configuration file of the application if the application is a non-test version. This scenario includes that the person concerned is not at the terminal where the application is located, such as the terminal of the application at the company and the relevant person at home. Specifically, the configuration file of the application is obtained by the terminal where the remote login application is located. Because of the limitation of remote login permission, security is further ensured to prevent non-related personnel from remotely logging in.
- the detection determining unit 602 is further configured to determine, according to a parameter for detecting a memory leak in the configuration file, whether a preset condition for detecting a memory leak is met.
- the parameter for detecting the memory leak includes a switch for detecting a memory leak. If the switch for detecting the memory leak in the configuration file is turned on, it is determined that the preset condition for detecting the memory leak is met, and the memory leak can be detected; if the memory leak is detected in the configuration file The switch is turned off, and it is determined that the preset condition for detecting the memory leak is not satisfied, and the memory leak cannot be detected. Through this program, relevant personnel can detect memory leaks anytime, anywhere.
- the detecting unit 502 is configured to: when the application meets the preset condition for detecting the memory leak, use the hook technology to add processing logic to the page lifecycle method of the application, and add processing logic to the single instance to detect whether the page of the application is There is a memory leak.
- the hook also known as hook, is a platform of the Windows message processing mechanism, the application can set a subroutine to monitor a certain message of the specified window, and the monitored window can be created by other processes. When the message arrives, it is processed before the target window handler.
- the hook mechanism allows the application to intercept processing window messages or specific events.
- the hook technology can be used to change the processing logic of the page life cycle method execution and the order of the code involved in the original method.
- the page life cycle method can execute the added processing logic first, and then execute the code logic involved in the original method.
- a singleton instance can be understood as a thread of the application management background, which is an instance of a singleton class. This singleton instance persists after the application is launched. It should be noted that adding processing logic to a singleton instance does not require the use of hook technology. If you can detect application memory leaks, use hook technology to add processing logic to the application's page lifecycle method, and add processing logic to the singleton instance to detect if there is a memory leak in the application's page.
- the application's page lifecycle methods include the method that the page will display, the method that the page will disappear, and the method of page destruction.
- the method that the page is to display refers to the method that is executed when the page is to be displayed.
- the method that the page will disappear refers to the method that is executed when the page is about to disappear, and the method of the page destruction refers to the method that is executed after the page is destroyed. method.
- the order in which the three methods are executed is the method that the page will display, the method that the page will disappear, and the method of page destruction. It should be noted that the page lifecycle method also involves other methods, which are not listed here. Specifically, as shown in FIG.
- the detecting unit includes a setting unit 701, a change starting unit 702, a leak detecting unit 703, and a leak determining unit 704.
- the setting unit 701 is configured to set the identification and display state of the page in the method to be displayed on the page of the application.
- each page is set with a page identifier and display status.
- Each page has a unique page identifier, and the display status of the page includes that it will be displayed, will disappear, destroyed, and so on.
- the page identification and display status of each page is preferably saved on the stack. Since the stack data structure is last in, first out, the last opened page is first closed and destroyed, so that the order of closing the destroyed pages is the same as the order of stacking in the stack.
- the change starting unit 702 is configured to change the display state of the page to a timer that is about to disappear and start the setting in the method in which the page is about to disappear.
- the change initiating unit 702 is further configured to change the display state of the page to be destroyed in the method of destroying the page. In actual execution, if the page still exists, the method of page destruction will not be executed, that is, the display state of the page will not be changed to destroyed.
- the leak detecting unit 703 is configured to judge whether the page exists according to the time recorded by the timer, the identifier of the page, and the display state in the single instance.
- the leak determination unit 704 is configured to determine and prompt that the page has a memory leak if the page exists. Specifically, the page may be prompted to have a memory leak in the form of a dialog box. This solution can quickly locate pages with memory leaks in the application to allow interested parties to focus on pages with memory leaks.
- the leak detection unit includes a time determination unit 801, a state acquisition unit 802, and a page determination unit 803.
- the time judging unit 801 is configured to determine whether the timer reaches a preset time.
- the state obtaining unit 802 is configured to obtain an identifier and a display state of the page if the timer reaches a preset time.
- the page determining unit 803 is configured to determine whether the page exists according to the identifier and the display state of the page. Specifically, the timer reaches the preset time. If the display state of the page is the destroyed state, the page does not exist; if the display state of the page is not the destroyed state, the page still exists. It can be understood that the page can be normally destroyed within a preset time. If the display state of the page is not the destroyed state after the preset time is reached, there may be a problem in the page, that is, there is a memory leak.
- the above embodiment utilizes the hook technology to add processing logic to the application life cycle method, and adds processing logic to the single instance to detect whether there is a memory leak in the application page, and can quickly locate the application memory leaked page. Improve the efficiency of detecting memory leaks.
- the above terminal can be implemented in the form of a computer program data which can be run on the terminal as shown in FIG.
- FIG. 9 is a schematic block diagram of another terminal according to an embodiment of the present application.
- the terminal 90 includes an input device 901, an output device 902, a memory 903, and a processor 904.
- the input device 901, the output device 902, the memory 903, and the processor 904 are connected by a bus 905. among them:
- the input device 901 is configured to provide an instruction to input an application memory leak, and the like.
- the input device 901 of the embodiment of the present application may include a keyboard, a mouse, a photoelectric input device, a sound input device, a touch input device, and the like.
- the output device 902 is configured to prompt the page for a memory leak or the like.
- the output device 902 of the embodiment of the present application may include a display, a display screen, a touch screen, and the like.
- the memory 903 includes a nonvolatile storage medium and an internal memory.
- the non-volatile storage medium can store operating system and computer program data.
- processor 904 can be caused to perform a method of detecting an application memory leak.
- the processor 904 is used to provide computing and control capabilities to support the operation of the entire terminal 90.
- the internal memory provides an environment for the execution of program data in a non-volatile storage medium that, when executed by the processor 904, causes the processor 904 to perform a method of detecting an application memory leak.
- the processor 904 is configured to execute program data stored in the memory 903 to perform any of the foregoing embodiments of a method of detecting an application memory leak.
- the processor 904 may be a central processing unit (CPU), and the processor 904 may also be another general-purpose processor, a digital signal processor (DSP), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device.
- DSP digital signal processor
- ASIC Application Specific Integrated Circuit
- FPGA Field-Programmable Gate Array
- the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the application further provides a computer readable storage medium storing one or more program data, the one or more program data being executable by one or more processors to implement the foregoing Any embodiment of a method of detecting an application memory leak.
- the computer readable storage medium may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal.
- the computer readable storage medium may also be an external storage device of the terminal, such as a plug-in hard disk equipped with the terminal, a smart memory card (SMC), a Secure Digital (SD) card, or the like. Further, the computer readable storage medium may also include both an internal storage unit of the terminal and an external storage device.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
Description
Claims (20)
- 一种检测应用程序内存泄露的方法,其特征在于,所述方法包括:若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件;若应用程序满足检测内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。
- 如权利要求1所述的方法,其特征在于,应用程序的页面生命周期方法包括页面将要显示的方法、页面将要消失的方法、页面销毁的方法,所述利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露,包括:在所述页面将要显示的方法中,设置所述页面的标识和显示状态;在所述页面将要消失的方法中,将所述页面的显示状态更改为即将消失,并启动设置的定时器;在所述页面销毁的方法中,将所述页面的显示状态更改为已销毁;在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在;若所述页面存在,确定所述页面存在内存泄露。
- 如权利要求2所述的方法,其特征在于,所述在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在,包括:判断定时器是否达到预设时间;若定时器达到预设时间,获取所述页面的标识和显示状态;根据所述页面的标识和显示状态来判断所述页面是否存在。
- 如权利要求1所述的方法,其特征在于,所述若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件,包括:若接收到检测应用程序内存泄露的指令,检测应用程序是否是测试版本;若所述应用程序是测试版本,则确定满足检测内存泄露的预设条件。
- 如权利要求4所述的方法,其特征在于,所述若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件,还包括:若所述应用程序是非测试版本,获取所述应用程序的配置文件;根据所述配置文件中检测内存泄露的参数来确定是否满足检测内存泄露的预设条件。
- 一种终端,其特征在于,所述终端包括:判断单元,用于若接收到检测应用程序内存泄露的指令,判断是否满足检测应用程序内存泄露的预设条件;检测单元,用于若应用程序满足检测内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。
- 如权利要求6所述的终端,其特征在于,所述应用程序的页面生命周期方法包括页面将要显示的方法、页面将要消失的方法、页面销毁的方法,所述检测单元包括:设置单元,用于在所述页面将要显示的方法中,设置所述页面的标识和显示状态;更改启动单元,用于在所述页面将要消失的方法中,将所述页面的显示状态更改为即将消失,启动设置的定时器;更改启动单元,还用于在所述页面销毁的方法中,将所述页面的显示状态更改为已销毁;泄露检测单元,用于在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在;泄露确定单元,用于若所述页面存在,确定所述页面存在内存泄露。
- 如权利要求7所述的终端,其特征在于,所述泄露检测单元包括:时间判断单元,用于判断定时器是否达到预设时间;状态获取单元,用于若定时器达到预设时间,获取所述页面的标识和显示状态;页面判断单元,用于根据所述页面的标识和显示状态来判断所述页面是否存在。
- 如权利要求6所述的终端,其特征在于,所述判断单元包括:测试版本检测单元,用于若接收到检测应用程序内存泄露的指令,检测应用程序是否是测试版本;检测确定单元,用于若所述应用程序是测试版本,则确定满足检测内存泄露的预设条件。
- 如权利要求9所述的终端,其特征在于,所述判断单元还包括:配置获取单元,用于若所述应用程序是非测试版本,获取应用程序的配置文件;所述检测确定单元,还用于根据配置文件中检测内存泄露的参数来确定是否满足检测内存泄露的预设条件。
- 一种终端,其特征在于,所述终端包括:存储器和处理器;所述存储器存储有可执行的程序数据;所述处理器用于运行所述存储器中存储的所述程序数据,以执行如下步骤:若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件;若应用程序满足检测内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。
- 如权利要求11所述的终端,其特征在于,应用程序的页面生命周期方法包括页面将要显示的方法、页面将要消失的方法、页面销毁的方法,所述处理器在执行所述利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露时,具体执行如下步骤:在所述页面将要显示的方法中,设置所述页面的标识和显示状态;在所述页面将要消失的方法中,将所述页面的显示状态更改为即将消失,并启动设置的定时器;在所述页面销毁的方法中,将所述页面的显示状态更改为已销毁;在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在;若所述页面存在,确定所述页面存在内存泄露。
- 如权利要求12所述的终端,其特征在于,所述处理器在执行所述在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在时,具体执行如下步骤:判断定时器是否达到预设时间;若定时器达到预设时间,获取所述页面的标识和显示状态;根据所述页面的标识和显示状态来判断所述页面是否存在。
- 如权利要求11所述的终端,其特征在于,所述处理器在执行所述若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件时,具体执行如下步骤:若接收到检测应用程序内存泄露的指令,检测应用程序是否是测试版本;若所述应用程序是测试版本,则确定满足检测内存泄露的预设条件。
- 如权利要求14所述的终端,其特征在于,所述处理器还执行如下步骤:若所述应用程序是非测试版本,获取所述应用程序的配置文件;根据所述配置文件中检测内存泄露的参数来确定是否满足检测内存泄露的预设条件。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现如下步骤:若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件;若应用程序满足检测内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。
- 如权利要求16所述的计算机可读存储介质,其特征在于,应用程序的页面生命周期方法包括页面将要显示的方法、页面将要消失的方法、页面销毁的方法,所述处理器在执行所述利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露时,具体实现如下步骤:在所述页面将要显示的方法中,设置所述页面的标识和显示状态;在所述页面将要消失的方法中,将所述页面的显示状态更改为即将消失,并启动设置的定时器;在所述页面销毁的方法中,将所述页面的显示状态更改为已销毁;在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在;若所述页面存在,确定所述页面存在内存泄露。
- 如权利要求17所述的计算机可读存储介质,其特征在于,所述处理器在执行所述在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在时,具体实现如下步骤:判断定时器是否达到预设时间;若定时器达到预设时间,获取所述页面的标识和显示状态;根据所述页面的标识和显示状态来判断所述页面是否存在。
- 如权利要求16所述的计算机可读存储介质,其特征在于,所述处理器在执行所述若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件时,具体实现如下步骤:若接收到检测应用程序内存泄露的指令,检测应用程序是否是测试版本;若所述应用程序是测试版本,则确定满足检测内存泄露的预设条件。
- 如权利要求19所述的计算机可读存储介质,其特征在于,所述处理器还实现如下步骤:若所述应用程序是非测试版本,获取所述应用程序的配置文件;根据所述配置文件中检测内存泄露的参数来确定是否满足检测内存泄露的预设条件。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710606666.5 | 2017-07-24 | ||
CN201710606666.5A CN107908539B (zh) | 2017-07-24 | 2017-07-24 | 一种检测应用程序内存泄露的方法、终端及计算机可读存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019019713A1 true WO2019019713A1 (zh) | 2019-01-31 |
Family
ID=61839964
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/083628 WO2019019713A1 (zh) | 2017-07-24 | 2018-04-19 | 检测应用程序内存泄露的方法、终端及可读存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107908539B (zh) |
WO (1) | WO2019019713A1 (zh) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107908539B (zh) * | 2017-07-24 | 2020-07-17 | 平安科技(深圳)有限公司 | 一种检测应用程序内存泄露的方法、终端及计算机可读存储介质 |
CN109542778A (zh) * | 2018-11-12 | 2019-03-29 | 中国银联股份有限公司 | 一种资源泄露检测的方法及装置 |
CN110618928A (zh) * | 2019-06-25 | 2019-12-27 | 北京无限光场科技有限公司 | 一种内存泄露检测方法、装置、终端设备及介质 |
CN111324534A (zh) * | 2020-02-18 | 2020-06-23 | 深圳中兴网信科技有限公司 | 内存泄漏的检测方法、装置、终端和计算机可读存储介质 |
CN112115048A (zh) * | 2020-08-26 | 2020-12-22 | 北京奇艺世纪科技有限公司 | 内存泄露检测方法、装置、电子设备及可读存储介质 |
CN111966603B (zh) * | 2020-09-04 | 2024-01-19 | 网易(杭州)网络有限公司 | 内存泄露的检测方法及装置、可读存储介质及电子设备 |
CN113688052A (zh) * | 2021-08-31 | 2021-11-23 | 南方电网科学研究院有限责任公司 | 一种电表应用程序内存泄露监测方法、终端、设备和介质 |
CN113900867A (zh) * | 2021-09-06 | 2022-01-07 | 浪潮软件股份有限公司 | 检测ios内存泄漏的方法、装置及计算机可读介质 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101908018A (zh) * | 2010-07-20 | 2010-12-08 | 北京海泰方圆科技有限公司 | 一种判断内存泄露的系统及方法 |
US8880757B1 (en) * | 2013-09-24 | 2014-11-04 | International Business Machines Corporation | RDMA resource leakage detection and reporting |
CN104572460A (zh) * | 2014-12-30 | 2015-04-29 | 大唐移动通信设备有限公司 | 一种内存泄露的检测方法和装置 |
CN106502880A (zh) * | 2016-09-20 | 2017-03-15 | 东软集团股份有限公司 | 一种内存泄漏调试方法及装置 |
CN107908539A (zh) * | 2017-07-24 | 2018-04-13 | 平安科技(深圳)有限公司 | 一种检测应用程序内存泄露的方法、终端及计算机可读存储介质 |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5689707A (en) * | 1995-12-04 | 1997-11-18 | Ncr Corporation | Method and apparatus for detecting memory leaks using expiration events and dependent pointers to indicate when a memory allocation should be de-allocated |
US7757039B2 (en) * | 2007-09-18 | 2010-07-13 | Nikos Kaburlasos | DRAM selective self refresh |
CN106610892B (zh) * | 2015-10-23 | 2020-12-22 | 腾讯科技(深圳)有限公司 | 内存泄漏检测方法和装置 |
CN105912458A (zh) * | 2016-03-28 | 2016-08-31 | 中国电力科学研究院 | 一种用于动态检测c/c++内存泄露的方法及系统 |
CN106407031B (zh) * | 2016-09-14 | 2019-05-28 | 华为数字技术(成都)有限公司 | 一种内存泄露定位方法及电子设备 |
CN106649105B (zh) * | 2016-12-08 | 2019-06-04 | 武汉斗鱼网络科技有限公司 | 一种内存泄漏的检测方法和装置 |
-
2017
- 2017-07-24 CN CN201710606666.5A patent/CN107908539B/zh active Active
-
2018
- 2018-04-19 WO PCT/CN2018/083628 patent/WO2019019713A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101908018A (zh) * | 2010-07-20 | 2010-12-08 | 北京海泰方圆科技有限公司 | 一种判断内存泄露的系统及方法 |
US8880757B1 (en) * | 2013-09-24 | 2014-11-04 | International Business Machines Corporation | RDMA resource leakage detection and reporting |
CN104572460A (zh) * | 2014-12-30 | 2015-04-29 | 大唐移动通信设备有限公司 | 一种内存泄露的检测方法和装置 |
CN106502880A (zh) * | 2016-09-20 | 2017-03-15 | 东软集团股份有限公司 | 一种内存泄漏调试方法及装置 |
CN107908539A (zh) * | 2017-07-24 | 2018-04-13 | 平安科技(深圳)有限公司 | 一种检测应用程序内存泄露的方法、终端及计算机可读存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN107908539B (zh) | 2020-07-17 |
CN107908539A (zh) | 2018-04-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019019713A1 (zh) | 检测应用程序内存泄露的方法、终端及可读存储介质 | |
US10691806B2 (en) | Self-measuring nonvolatile memory device systems and methods | |
KR101702289B1 (ko) | 플랫폼 부트 펌웨어에 대한 신뢰의 연속성 | |
TWI791975B (zh) | 藉由監測對基本輸入/輸出系統(bios)或統一可延伸韌體介面(uefi)屬性進行之組態改變之鏈來偵測安全威脅 | |
US20230004648A1 (en) | Firmware Integrity Check Using Silver Measurements | |
US20160224789A1 (en) | System and method for hypervisor-based security | |
CN110929264B (zh) | 漏洞检测方法、装置、电子设备及可读存储介质 | |
US20140331037A1 (en) | Secure boot override in a computing device equipped with unified-extensible firmware interface (uefi)-compliant firmware | |
CN105608386A (zh) | 一种可信计算终端完整性度量、证明方法及装置 | |
WO2020019485A1 (zh) | 一种模拟器识别方法、识别设备及计算机可读介质 | |
US10185633B2 (en) | Processor state integrity protection using hash verification | |
WO2016078323A1 (zh) | 检测恶意软件的方法及装置 | |
US11055168B2 (en) | Unexpected event detection during execution of an application | |
TWI779515B (zh) | 用於判定有無篡改統一可擴展韌體介面(uefi)之方法及系統、及相關非暫時性電腦可讀媒體 | |
CN105550585A (zh) | 一种应用程序安全性测试方法、装置和系统 | |
CN109684795A (zh) | 应用程序反调试的方法、装置及电子设备 | |
US10296730B2 (en) | Systems and methods for automatic generation and retrieval of an information handling system password | |
US10375576B1 (en) | Detection of malware apps that hijack app user interfaces | |
TWI656453B (zh) | 檢測系統及檢測方法 | |
TW201421233A (zh) | 主機板功能測試管控系統及方法 | |
WO2020134033A1 (zh) | 用于确定应用程序在运行时的安全性的方法及其装置 | |
WO2022121333A1 (zh) | 一种启动应用程序的方法及装置 | |
KR20140061470A (ko) | 안전한 키 자가―생성 | |
CN110362983B (zh) | 一种保证双域系统一致性的方法、装置及电子设备 | |
US20170177863A1 (en) | Device, System, and Method for Detecting Malicious Software in Unallocated Memory |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18839386 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18839386 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03.08.2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18839386 Country of ref document: EP Kind code of ref document: A1 |