WO2019019713A1 - 检测应用程序内存泄露的方法、终端及可读存储介质 - Google Patents

检测应用程序内存泄露的方法、终端及可读存储介质 Download PDF

Info

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
Application number
PCT/CN2018/083628
Other languages
English (en)
French (fr)
Inventor
林志成
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019019713A1 publication Critical patent/WO2019019713A1/zh

Links

Images

Classifications

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

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

检测应用程序内存泄露的方法、终端及可读存储介质
本申请要求于2017年7月24日提交中国专利局、申请号为201710606666.5、发明名称为“一种检测应用程序内存泄露的方法、终端及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及测试技术领域,尤其涉及一种检测应用程序内存泄露的方法、终端及计算机可读存储介质。
背景技术
在应用程序开发的过程中需要对应用程序进行测试以检测是否存在内存泄露,现有的检测内存泄露的方法较为繁琐,如对于在苹果操作系统(iphone OS,IOS)上开发的应用程序,必须使用开发工具(开发工具名称为Xcode)自带的辅助工具(辅助工具名称为instrument)才能检测出是否存在内存泄露,并且使用的步骤较为繁琐,检测内存泄露的效率低。
发明内容
本申请实施例提供了一种检测应用程序内存泄露的方法、终端及计算机可读存储介质,可以快速检测应用程序的页面是否存在内存泄露,提高检测内存泄露的效率。
第一方面,本申请实施例提供了一种检测应用程序内存泄露的方法,该方法包括:
若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件;
若应用程序满足检测内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应 用程序的页面是否存在有内存泄露。
第二方面,本申请实施例提供了一种终端,该终端包括:
判断单元,用于若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件;
检测单元,用于若应用程序满足检测内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。
第三方面,本申请实施例提供了另一种终端,该终端包括:存储器和处理器;所述存储器存储有可执行的程序数据;所述处理器用于运行所述存储器中存储的所述程序数据,以执行上述第一方面所述的方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序可被一个或者一个以上的处理器执行,以实现上述第一方面所述的方法。
本申请实施例可以快速检测应用程序的页面是否有内存泄露,提高检测内存泄露的效率。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种检测应用程序内存泄露的方法的示意流程图;
图2是本申请实施例提供的一种检测应用程序内存泄露的方法的子流程示意图;
图3是本申请实施例提供的一种检测应用程序内存泄露的方法的子流程示意图;
图4是图3发明实施例提供的子流程示意图;
图5是本申请实施例提供的一种终端的示意性框图;
图6是本申请实施例提供的判断单元的示意性框图;
图7是本申请实施例提供的检测单元的示意性框图;
图8是本申请实施例提供的泄露检测单元的示意性框图;
图9是本申请实施例提供的另一种终端的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
具体实现中,本申请实施例中描述的终端包括但不限于可以安装并运行应用程序的诸如移动电话、膝上型计算机或平板计算机之类的其它便携式终端。还应当理解的是,在某些实施例中,所述终端并非便携式通信终端,还包括可以安装并运行应用程序的台式计算机等。优选地,本申请实施例应用于IOS开发的终端中。
图1为本申请实施例提供的一种检测应用程序内存泄露的方法流程示意图。该方法包括S101~S102。
S101,若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件。具体地,如图2所示,S101包括S201-S204。S201,若接收到检测应用程序内存泄露的指令,检测应用程序是否是测试版本。如通过应用程序的标识符来检测应用程序是否为测试版本,应用程序的标识符可以包括1和0,其中,1表示为测试版本,0表示不为测试版本。测试版本默认检测内存泄露的开关是打开的。S202,若应用程序是测试版本,则确定满足检测内存泄露的预设条件。S203,若应用程序是非测试版本,获取应用程序的配置 文件。该种情形包括相关人员不在应用程序所在的终端旁,如应用程序的终端在公司,而相关人员在家里。具体地,通过远程登陆应用程序所在的终端获取应用程序的配置文件。因为有远程登陆权限的限制,进一步保证了安全,以防非相关人员远程登陆。S204,根据配置文件中检测内存泄露的参数来确定是否满足检测内存泄露的预设条件。其中,检测内存泄露的参数包括检测内存泄露的开关,若配置文件中检测内存泄露的开关是打开的,则确定满足检测内存泄露的预设条件,可以检测内存泄露;若配置文件中检测内存泄露的开关是关闭的,则确定不满足检测内存泄露的预设条件,不能检测内存泄露。通过该方案,相关人员可以随时随地检测内存泄露。
S102,若满足检测应用程序内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。其中,钩子,也称为hook,是WindoWs消息处理机制的一个平台,应用程序可以在上面设置子程以监视指定窗口的某种消息,而且所监视的窗口可以是其他进程所创建的。当消息到达后,在目标窗口处理函数之前处理它。钩子机制允许应用程序截获处理windoW消息或特定事件。使用hook技术可以改变页面生命周期方法执行加入的处理逻辑,以及执行原来方法中涉及的代码的顺序,如可以让页面生命周期方法先执行加入的处理逻辑,再执行原来方法中涉及的代码逻辑。其中,单例实例可以理解为应用程序管理后台的一个线程,是单例类的实例。应用程序启动后,该单例实例一直存在。需要注意的是,在单例实例中加入处理逻辑无需使用hook技术,因为该单例实例一直在运行。若可以检测应用程序内存泄露,利用hook技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,来检测应用程序的页面是否存在有内存泄露。
应用程序的页面生命周期方法包括页面将要显示的方法、页面将要消失的方法、页面销毁的方法。其中,页面将要显示的方法指的是在页面将要显示的时候执行的方法,页面将要消失的方法指的是在页面将要消失时执行的方法,页面销毁的方法指的是在页面销毁后执行的方法。该三个方法执行的先后顺序为页面将要显示的方法、页面将要消失的方法、页面销毁的方法。需要注意的是,页面生命周期方法还涉及有其他的方法,这里不一一列出。具体地,如图 3所示,S102包括S301-S305。S301,在应用程序的页面将要显示的方法中,设置页面的标识和显示状态。其中,每个页面都设置有页面标识和显示状态。每个页面有唯一的页面标识,页面的显示状态包括将要显示、将要消失、已销毁等。每个页面的页面标识和显示状态优选保存在堆栈里。由于堆栈数据结构为后进先出,最后打开的页面,最先关闭销毁,使得关闭销毁页面的顺序与堆栈里出栈的顺序一致。一方面,加快了销毁页面的速度,另一方面,更能精确到哪个页面存在内存泄露。S302,在该页面将要消失的方法中,将页面的显示状态更改为即将消失,并启动设置的定时器。S303,在该页面销毁的方法中,将该页面的显示状态更改为已销毁。在实际执行中,若页面还存在,那么将不会执行页面销毁的方法,也就是不会将页面的显示状态更改为已销毁。S304,在单例实例中,根据定时器记录的时间,以及该页面的标识和显示状态判断该页面是否存在。若在定时器记录的预设时间内,该页面的显示状态更改为已销毁,那么该页面已经不存在了,若定时器达到预设时间,该页面的显示状态仍然是其他的状态,如将要消失的状态,即不是已销毁的状态,那么该页面仍然存在。其中,预设时间优选为5秒。S305,若该页面存在,确定并提示该页面存在内存泄露。具体地,可以以对话框的形式来提示该页面存在内存泄露。该方案可以快速定位应用程序中有内存泄露的页面,以让相关人员关注存在有内存泄露的页面。
具体地,如图4所示,S304包括S401-S403。S401,判断定时器是否达到预设时间。若定时器没有达到预设时间,接着执行S401;若定时器达到预设时间,执行S402。S402,若定时器达到预设时间,获取该页面的标识和显示状态。S403,根据该页面的标识和显示状态来判断该页面是否存在。具体地,定时器达到预设时间,若页面的显示状态为已销毁的状态,那么该页面不存在了;若页面的显示状态不为已销毁的状态,那么该页面还存在。可以理解为,在预设时间内,页面都可以正常销毁,若达到预设时间后,该页面的显示状态不为已销毁状态,那么该页面可能出现问题,即存在内存泄露。
在其他实施例中,也可以在页面消失的方法中设置并启动定时器,由于在页面生命周期中,先执行页面将要消失的方法,再执行页面消失的方法,因此若在页面消失的方法中设置并启动定时器,那么对应的预设时间就会比在页面 即将消失的方法中设置并启动定时器对应的预设时间少一些。
上述实施例利用用hook技术在应用程序生命周期的方法中加入处理逻辑,以及在单例实例中加入处理逻辑,来检测应用程序的页面是否存在有内存泄露,可以快速定位应用程序内存泄露的页面,提高检测内存泄露的效率。
图5为本申请实施例提供的一种终端的示意性框图。该终端50包括判断单元501、检测单元502。
判断单元501用于若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件。具体地,如图6所示,判断单元包括测试版本检测单元601、检测确定单元602、配置获取单元603。测试版本检测单元601用于若接收到检测应用程序内存泄露的指令,检测应用程序是否是测试版本。如通过应用程序的标识符来检测应用程序是否为测试版本,应用程序的标识符可以包括1和0,其中,1表示为测试版本,0表示不为测试版本。测试版本默认检测内存泄露的开关是打开的。检测确定单元602用于若应用程序是测试版本,则确定满足检测内存泄露的预设条件。配置获取单元603用于若应用程序是非测试版本,获取应用程序的配置文件。该种情形包括相关人员不在应用程序所在的终端旁,如应用程序的终端在公司,而相关人员在家里。具体地,通过远程登陆应用程序所在的终端获取应用程序的配置文件。因为有远程登陆权限的限制,进一步保证了安全,以防非相关人员远程登陆。检测确定单元602还用于根据配置文件中检测内存泄露的参数来确定是否满足检测内存泄露的预设条件。其中,检测内存泄露的参数包括检测内存泄露的开关,若配置文件中检测内存泄露的开关是打开的,则确定满足检测内存泄露的预设条件,可以检测内存泄露;若配置文件中检测内存泄露的开关是关闭的,则确定不满足检测内存泄露的预设条件,不能检测内存泄露。通过该方案,相关人员可以随时随地检测内存泄露。
检测单元502用于若应用程序满足检测内存泄露的预设条件,利用hook技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。其中,钩子,也称为hook,是Windows消息处理机制的一个平台,应用程序可以在上面设置子程以监视指定窗口的某种消息,而且所监视的窗口可以是其他进程所创建的。当消 息到达后,在目标窗口处理函数之前处理它。钩子机制允许应用程序截获处理window消息或特定事件。使用hook技术可以改变页面生命周期方法执行加入的处理逻辑,以及执行原来方法中涉及的代码的顺序,如可以让页面生命周期方法先执行加入的处理逻辑,再执行原来方法中涉及的代码逻辑。其中,单例实例可以理解为应用程序管理后台的一个线程,是单例类的实例。应用程序启动后,该单例实例一直存在。需要注意的是,在单例实例中加入处理逻辑无需使用hook技术。若可以检测应用程序内存泄露,利用hook技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,来检测应用程序的页面是否存在有内存泄露。
应用程序的页面生命周期方法包括页面将要显示的方法、页面将要消失的方法、页面销毁的方法。其中,页面将要显示的方法指的是在页面将要显示的时候执行的方法,页面将要消失的方法指的是在页面将要消失时执行的方法,页面销毁的方法指的是在页面销毁后执行的方法。该三个方法执行的先后顺序为页面将要显示的方法、页面将要消失的方法、页面销毁的方法。需要注意的是,页面生命周期方法还涉及有其他的方法,这里不一一列出。具体地,如图7所示,检测单元包括设置单元701、更改启动单元702、泄露检测单元703、泄露确定单元704。设置单元701用于在应用程序的页面将要显示的方法中,设置页面的标识和显示状态。其中,每个页面都设置有页面标识和显示状态。每个页面有唯一的页面标识,页面的显示状态包括将要显示、将要消失、已销毁等。每个页面的页面标识和显示状态优选保存在堆栈里。由于堆栈数据结构为后进先出,最后打开的页面,最先关闭销毁,使得关闭销毁页面的顺序与堆栈里出栈的顺序一致。一方面,加快了销毁页面的速度,另一方面,更能精确判断出哪个页面存在内存泄露。更改启动单元702用于在该页面将要消失的方法中,将页面的显示状态更改为即将消失,启动设置的定时器。更改启动单元702还用于在该页面销毁的方法中,将该页面的显示状态更改为已销毁。在实际执行中,若页面还存在,那么将不会执行页面销毁的方法,也就是不会将页面的显示状态更改为已销毁。泄露检测单元703用于在单例实例中,根据定时器记录的时间,以及该页面的标识和显示状态判断该页面是否存在。若在定时器记录的预设时间内,该页面的显示状态更改为已销毁,那么该页面已经不存 在了,若定时器达到预设时间,该页面的显示状态仍然是其他的状态,如将要消失的状态,即不是已销毁的状态,那么该页面仍然存在。其中,预设时间优选为5秒。泄露确定单元704用于若该页面存在,确定并提示该页面存在内存泄露。具体地,可以以对话框的形式来提示该页面存在内存泄露。该方案可以快速定位应用程序中有内存泄露的页面,以让相关人员关注存在有内存泄露的页面。
具体地,如图8所示,泄露检测单元包括时间判断单元801、状态获取单元802、页面判断单元803。时间判断单元801,用于判断定时器是否达到预设时间。状态获取单元802,用于若定时器达到预设时间,获取该页面的标识和显示状态。页面判断单元803,用于根据该页面的标识和显示状态来判断该页面是否存在。具体地,定时器达到预设时间,若页面的显示状态为已销毁的状态,那么该页面不存在了;若页面的显示状态不为已销毁的状态,那么该页面还存在。可以理解为,在预设时间内,页面都可以正常销毁,若达到预设时间后,该页面的显示状态不为已销毁状态,那么该页面可能出现问题,即存在内存泄露。
上述实施例利用用hook技术在应用程序生命周期的方法中加入处理逻辑,以及在单例实例中加入处理逻辑,来检测应用程序的页面是否存在有内存泄露,可以快速定位应用程序内存泄露的页面,提高检测内存泄露的效率。
上述终端可以实现为一种计算机程序数据的形式,该程序数据可以在如图9所示的终端上运行。
图9为本申请实施例提供的另一种终端的示意性框图。该终端90包括输入装置901、输出装置902、存储器903以及处理器904,上述输入装置901、输出装置902、存储器903以及处理器904通过总线905连接。其中:
输入装置901用于提供输入检测应用程序内存泄露的指令等。具体实现中,本申请实施例的输入装置901可包括键盘、鼠标、光电输入装置、声音输入装置、触摸式输入装置等。输出装置902用于提示页面存在内存泄露等。具体实现中,本申请实施例的输出装置902可包括显示器、显示屏、触摸屏等。
存储器903包括非易失性存储介质和内存储器。该非易失性存储介质可存储操作系统和计算机程序数据。该程序数据被执行时,可使得处理器904执行 一种检测应用程序内存泄露的方法。该处理器904用于提供计算和控制能力,支撑整个终端90的运行。该内存储器为非易失性存储介质中的程序数据的运行提供环境,该程序数据被处理器904执行时,可使得处理器904执行一种检测应用程序内存泄露的方法。
处理器904用于运行存储器903中存储的程序数据,以执行前述一种检测应用程序内存泄露的方法的任一实施例。
应当理解,在本申请实施例中,处理器904可以是中央处理单元(Central Processing Unit,CPU),该处理器904还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现前述一种检测应用程序内存泄露的方法的任一实施例。
所述计算机可读存储介质可以是终端的内部存储单元,例如终端的硬盘或内存。所述计算机可读存储介质也可以是终端的外部存储设备,例如所述终端上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡等。进一步地,所述计算机可读存储介质还可以既包括所述终端的内部存储单元也包括外部存储设备。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的终端和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本申请所提供的几个实施例中,应该理解到,所揭露的终端和方法,可以通过其它的方式实现。例如,以上所描述的终端实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种检测应用程序内存泄露的方法,其特征在于,所述方法包括:
    若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件;
    若应用程序满足检测内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。
  2. 如权利要求1所述的方法,其特征在于,应用程序的页面生命周期方法包括页面将要显示的方法、页面将要消失的方法、页面销毁的方法,
    所述利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露,包括:
    在所述页面将要显示的方法中,设置所述页面的标识和显示状态;
    在所述页面将要消失的方法中,将所述页面的显示状态更改为即将消失,并启动设置的定时器;
    在所述页面销毁的方法中,将所述页面的显示状态更改为已销毁;
    在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在;若所述页面存在,确定所述页面存在内存泄露。
  3. 如权利要求2所述的方法,其特征在于,所述在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在,包括:
    判断定时器是否达到预设时间;
    若定时器达到预设时间,获取所述页面的标识和显示状态;
    根据所述页面的标识和显示状态来判断所述页面是否存在。
  4. 如权利要求1所述的方法,其特征在于,所述若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件,包括:
    若接收到检测应用程序内存泄露的指令,检测应用程序是否是测试版本;
    若所述应用程序是测试版本,则确定满足检测内存泄露的预设条件。
  5. 如权利要求4所述的方法,其特征在于,所述若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件,还包括:
    若所述应用程序是非测试版本,获取所述应用程序的配置文件;
    根据所述配置文件中检测内存泄露的参数来确定是否满足检测内存泄露的预设条件。
  6. 一种终端,其特征在于,所述终端包括:
    判断单元,用于若接收到检测应用程序内存泄露的指令,判断是否满足检测应用程序内存泄露的预设条件;
    检测单元,用于若应用程序满足检测内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。
  7. 如权利要求6所述的终端,其特征在于,所述应用程序的页面生命周期方法包括页面将要显示的方法、页面将要消失的方法、页面销毁的方法,所述检测单元包括:
    设置单元,用于在所述页面将要显示的方法中,设置所述页面的标识和显示状态;
    更改启动单元,用于在所述页面将要消失的方法中,将所述页面的显示状态更改为即将消失,启动设置的定时器;
    更改启动单元,还用于在所述页面销毁的方法中,将所述页面的显示状态更改为已销毁;
    泄露检测单元,用于在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在;
    泄露确定单元,用于若所述页面存在,确定所述页面存在内存泄露。
  8. 如权利要求7所述的终端,其特征在于,所述泄露检测单元包括:
    时间判断单元,用于判断定时器是否达到预设时间;
    状态获取单元,用于若定时器达到预设时间,获取所述页面的标识和显示状态;
    页面判断单元,用于根据所述页面的标识和显示状态来判断所述页面是否存在。
  9. 如权利要求6所述的终端,其特征在于,所述判断单元包括:
    测试版本检测单元,用于若接收到检测应用程序内存泄露的指令,检测应用程序是否是测试版本;
    检测确定单元,用于若所述应用程序是测试版本,则确定满足检测内存泄露的预设条件。
  10. 如权利要求9所述的终端,其特征在于,所述判断单元还包括:
    配置获取单元,用于若所述应用程序是非测试版本,获取应用程序的配置文件;
    所述检测确定单元,还用于根据配置文件中检测内存泄露的参数来确定是否满足检测内存泄露的预设条件。
  11. 一种终端,其特征在于,所述终端包括:存储器和处理器;所述存储器存储有可执行的程序数据;所述处理器用于运行所述存储器中存储的所述程序数据,以执行如下步骤:
    若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件;
    若应用程序满足检测内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。
  12. 如权利要求11所述的终端,其特征在于,应用程序的页面生命周期方法包括页面将要显示的方法、页面将要消失的方法、页面销毁的方法,所述处理器在执行所述利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露时,具体执行如下步骤:
    在所述页面将要显示的方法中,设置所述页面的标识和显示状态;
    在所述页面将要消失的方法中,将所述页面的显示状态更改为即将消失,并启动设置的定时器;
    在所述页面销毁的方法中,将所述页面的显示状态更改为已销毁;
    在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在;若所述页面存在,确定所述页面存在内存泄露。
  13. 如权利要求12所述的终端,其特征在于,所述处理器在执行所述在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在时,具体执行如下步骤:
    判断定时器是否达到预设时间;
    若定时器达到预设时间,获取所述页面的标识和显示状态;
    根据所述页面的标识和显示状态来判断所述页面是否存在。
  14. 如权利要求11所述的终端,其特征在于,所述处理器在执行所述若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件时,具体执行如下步骤:
    若接收到检测应用程序内存泄露的指令,检测应用程序是否是测试版本;
    若所述应用程序是测试版本,则确定满足检测内存泄露的预设条件。
  15. 如权利要求14所述的终端,其特征在于,所述处理器还执行如下步骤:
    若所述应用程序是非测试版本,获取所述应用程序的配置文件;
    根据所述配置文件中检测内存泄露的参数来确定是否满足检测内存泄露的预设条件。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现如下步骤:
    若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件;
    若应用程序满足检测内存泄露的预设条件,利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,应用程序的页面生命周期方法包括页面将要显示的方法、页面将要消失的方法、页面销毁的方法,所述处理器在执行所述利用钩子技术在应用程序的页面生命周期方法中加入处理逻辑,以及在单例实例中加入处理逻辑,以检测应用程序的页面是否存在有内存泄露时,具体实现如下步骤:
    在所述页面将要显示的方法中,设置所述页面的标识和显示状态;
    在所述页面将要消失的方法中,将所述页面的显示状态更改为即将消失,并启动设置的定时器;
    在所述页面销毁的方法中,将所述页面的显示状态更改为已销毁;
    在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在;若所述页面存在,确定所述页面存在内存泄露。
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述处理器在执行所述在所述单例实例中,根据定时器记录的时间,以及所述页面的标识和显示状态判断所述页面是否存在时,具体实现如下步骤:
    判断定时器是否达到预设时间;
    若定时器达到预设时间,获取所述页面的标识和显示状态;
    根据所述页面的标识和显示状态来判断所述页面是否存在。
  19. 如权利要求16所述的计算机可读存储介质,其特征在于,所述处理器在执行所述若接收到检测应用程序内存泄露的指令,判断应用程序是否满足检测内存泄露的预设条件时,具体实现如下步骤:
    若接收到检测应用程序内存泄露的指令,检测应用程序是否是测试版本;
    若所述应用程序是测试版本,则确定满足检测内存泄露的预设条件。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述处理器还实现如下步骤:
    若所述应用程序是非测试版本,获取所述应用程序的配置文件;
    根据所述配置文件中检测内存泄露的参数来确定是否满足检测内存泄露的预设条件。
PCT/CN2018/083628 2017-07-24 2018-04-19 检测应用程序内存泄露的方法、终端及可读存储介质 WO2019019713A1 (zh)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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 武汉斗鱼网络科技有限公司 一种内存泄漏的检测方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
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