WO2018072408A1 - 一种内存分析方法、装置、系统以及计算设备 - Google Patents

一种内存分析方法、装置、系统以及计算设备 Download PDF

Info

Publication number
WO2018072408A1
WO2018072408A1 PCT/CN2017/080261 CN2017080261W WO2018072408A1 WO 2018072408 A1 WO2018072408 A1 WO 2018072408A1 CN 2017080261 W CN2017080261 W CN 2017080261W WO 2018072408 A1 WO2018072408 A1 WO 2018072408A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
suspicious
monitored
memory image
parsing
Prior art date
Application number
PCT/CN2017/080261
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 WO2018072408A1 publication Critical patent/WO2018072408A1/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/3604Software analysis for verifying properties of programs
    • G06F11/3612Software analysis for verifying properties of programs by runtime analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a memory analysis method, apparatus, system, and computing device.
  • the technical problem to be solved by the present invention is to provide a memory analysis method, apparatus, system and computing device, which can effectively determine the object distribution of the heap memory consumption abnormal time.
  • a memory analysis method including a memory image parsing process, where the memory image parsing process includes: acquiring a memory image file of the heap data of the process to be monitored; and parsing the memory image file to obtain a predetermined type of object. Object information and object reference relationship; and determining a suspicious object based on the object information; and generating an object reference chain of the suspicious object based on the object reference relationship.
  • the object information and the object reference relationship can be obtained, so that the object reference chain of the suspicious object and the suspicious object can be analyzed therefrom.
  • the suspicious object may be an object whose size exceeds a predetermined threshold.
  • the step of determining the suspicious object based on the object information may include: determining that the one or more objects having the largest size are suspicious objects; or determining that the object whose size is greater than the first predetermined threshold is a suspicious object.
  • the object that causes the OOM error is generally a large-sized object, one or more objects of a larger size can be considered as suspicious objects.
  • the step of parsing the memory image file may include: calculating an object dominance tree by using a topological sorting algorithm to obtain an object reference relationship.
  • the step of parsing the memory mirror file only the object information and the object reference relationship of the predetermined type object whose size is larger than the second predetermined threshold may be acquired, and the second predetermined threshold is less than or equal to the first predetermined threshold.
  • part of the object information and the object reference relationship in the memory image file can be obtained, thereby reducing the workload and improving the efficiency of memory analysis.
  • the memory analysis method may further include: uploading an object reference chain of the suspicious object to the server.
  • the memory analysis method may further include: performing an anti-aliasing process on the object reference chain of the suspicious object by the server.
  • the memory image parsing process is performed in at least one of the following cases: in a case where a device for executing a process to be monitored is currently in a lock screen state; and a case in which a process to be monitored is in a background running state In the case where the process to be monitored is a grayscale version; The case where the device of the control process belongs to the target model; if the size of the heap data of the process to be monitored exceeds the third predetermined threshold; in the case where the last execution of the memory image analysis process exceeds the predetermined time threshold.
  • the memory analysis method of the present invention can be used on a terminal device that executes one or more processes, and before performing the memory image parsing process in the memory analysis method, it can also determine whether the current device meets a predetermined condition, and is in compliance with the predetermined condition. In the case of the condition, the memory image analysis processing is executed again.
  • a memory analysis apparatus including a memory image analysis processing module, where the memory image analysis processing module includes: an acquisition unit, a memory image file for acquiring heap data of a process to be monitored; For parsing the memory image file to obtain object information and object reference relationship of the predetermined type object; the suspicious object determining unit is configured to determine the suspicious object based on the object information; the object reference chain generating unit generates the object of the suspicious object based on the object reference relationship Reference chain.
  • the parsing unit may calculate the object dominance tree by using a topological sorting algorithm to obtain an object citation relationship.
  • the memory analyzing device may further include: an uploading unit, configured to upload the object reference chain of the suspicious object to the server.
  • the manner in which the suspicious object determining unit determines the suspicious object based on the object information comprises:
  • the object whose size is greater than the first predetermined threshold is determined to be a suspicious object.
  • the parsing unit acquires object information and an object reference relationship of a predetermined type of object whose size is greater than a second predetermined threshold, the second predetermined threshold being less than or equal to a first predetermined threshold.
  • the memory image parsing processing module performs the memory mirroring parsing process in at least one of the following cases: in a case where the device for executing the process to be monitored is currently in a lock screen state; in the process to be monitored In the case of a background running state; in the case where the process to be monitored is a grayscale version; and/or in the case where the device for executing the process to be monitored belongs to the target model; the size of the heap data of the process to be monitored exceeds In the case of the third predetermined threshold; in the case where the last execution of the memory mirror analysis processing exceeds the predetermined time threshold.
  • a computing device comprising: a memory for storing heap data corresponding to one or more processes; and a processor for acquiring to be monitored A memory image file of the heap data of the process, parsing the memory image file to obtain object information and object reference relationship of the predetermined type object, determining the suspicious object based on the object information, and generating an object reference chain of the suspicious object based on the object reference relationship.
  • the computing device may further comprise: communication means for uploading the object reference chain of the suspicious object to the server.
  • an in-memory analysis system comprising a computing device and a server, wherein:
  • the computing device includes: a memory and a communication device, the memory is configured to store heap data corresponding to one or more processes, and the communication device is configured to upload an object reference chain of the suspicious object to a server;
  • a processor configured to obtain a memory image file of the heap data of the process to be monitored, parse the memory image file to obtain object information and an object reference relationship of a predetermined type of object, determine a suspicious object based on the object information, and An object reference relationship generates an object reference chain of the suspicious object;
  • the server is configured to perform an anti-aliasing process on the object reference chain of the suspicious object.
  • the present invention focuses on large objects (for example, a long byte array) according to the long tail theory and actual conditions, and lists large objects as suspicious objects by acquiring
  • large objects for example, a long byte array
  • the suspicious objects in the heap data of the process and the chain of references to the suspicious objects can identify the cause of the excessive heap usage of the Java program.
  • FIG. 1 is a schematic block diagram showing the structure of a memory analyzing device according to an embodiment of the present invention.
  • FIG. 2 shows a schematic flow chart of a memory analysis method according to an embodiment of the invention.
  • FIG. 3 shows a schematic flow chart of a memory analysis method according to another embodiment of the present invention.
  • FIG. 4 shows a schematic block diagram of the structure of a computing device in accordance with an embodiment of the present invention.
  • FIG. 5 shows a schematic block diagram of the structure of a memory analysis system in accordance with an embodiment of the present invention.
  • Memory mirroring The heap information of a process.
  • Hprof file The file of the obtained memory image, Hprof is the file name suffix.
  • JVM The virtual machine where the Java program is running.
  • OOM Out Of Memory Error in the Java language, because the heap space is exhausted, causing the program to fail to apply for the memory required by the object, resulting in a crash.
  • the present invention provides an in-memory analysis solution capable of determining the reference relationship between the abnormal object and the abnormal object in the heap data of the JVM. Based on the solution of the present invention, it can be clearly understood that the OOM may be caused. The distribution of the wrong suspicious object.
  • FIG. 1 is a schematic block diagram showing the structure of a memory analyzing device according to an embodiment of the present invention.
  • FIG. 2 shows a schematic flow chart of a memory analysis method according to an embodiment of the invention.
  • the memory analysis apparatus of this embodiment includes a memory image analysis processing module 100.
  • the memory image parsing processing module 100 includes an obtaining unit 110, a parsing unit 120, a suspicious object determining unit 130, and an object reference chain generating unit 140.
  • the memory analysis method of the embodiment includes a memory image analysis process 200, and the memory image analysis process 200 can be implemented by the memory image analysis processing module 100.
  • the all or most of the steps of the memory image parsing process 200 may be performed on the terminal device running the process to be monitored, where the terminal device may be an Android device or other devices.
  • the maximum value of the heap memory allocated to the process for executing the memory image parsing process 200 (which may be referred to as an Hprof process) may be expanded. In this way, it is possible to avoid the situation that the normal execution cannot be performed due to insufficient memory during the execution of the memory image parsing process 200.
  • the rationality of the Intent corresponding to the memory image analysis processing 200 can be determined. For example, you can find the corresponding group based on the description of the Intent. And pass the Intent to the calling component and complete the call to the component.
  • step S210 for example, the memory mirror file of the heap data of the process to be monitored may be acquired by the obtaining unit 110.
  • the corresponding method can be selected to obtain the memory mirror file.
  • the heap data of the process to be monitored may be locked before the step S210 is performed or the process of the step S210 is performed, so that the process to be monitored cannot operate on the heap data. In this way, it is possible to prevent the heap data from being modified during the execution of the analysis scheme of the present invention (the modification here may be a modification of the heap data itself or a modification of the reference relationship).
  • the memory mirror file may be parsed by the parsing unit 120 to acquire object information and an object reference relationship of a predetermined type of object.
  • the type object whose size can be larger than the first predetermined threshold is taken as the predetermined type object, and then the object information and the object reference relationship of the predetermined type object are acquired.
  • the predetermined type object may be a type object such as a picture (Bitmap), a byte[], or the like that may have a larger size.
  • the object dominance tree can be calculated by a topological sorting algorithm to obtain an object reference relationship.
  • you can establish a tree-dependent reference relationship that is, the object dominance tree
  • the tree-dependent reference relationship of the object can be calculated without calculating the retained size. That is to say, when the object of the computing object dominates the tree, only the space occupied by the object itself can be calculated (shallow Size).
  • the retained size is the size of the object itself (ie, the shallow size), plus the sum of the shallow sizes from which the object can be directly or indirectly accessed. In other words, retained size is the sum of memory that can be recycled after the object is GC (garbage collection).
  • the shallow size is the size of the memory occupied by the object itself, and does not contain the object it references.
  • the suspicious object may be determined based on the object information, for example, by the suspicious object determining unit 130.
  • the object information having a larger size can be considered as a suspicious object.
  • the first predetermined threshold may be set to 20M, and then an object having a size larger than 20M may be determined as a suspicious object.
  • the second predetermined threshold is less than or equal to the first A predetermined threshold.
  • the second predetermined threshold may be set to 1M and the first predetermined threshold may be set to 10M.
  • the object reference chain generating unit 140 may generate an object reference chain of the suspicious object based on the object reference relationship.
  • an object reference chain of suspicious objects can be derived.
  • the server For the resulting suspicious object and/or suspicious object reference chain, you can upload it to the server (here, you can convert the suspicious object reference chain into a JSON string (which can also be a text file) and then pass the relevant components (for example, you can It is uploaded to the server by CrashSDK), and the server displays it to indicate the suspicious object in actual operation, so that the relevant personnel on the server side can further process according to the suspicious object displayed and the reference relationship of the suspicious object.
  • a JSON string which can also be a text file
  • the server can deobfuscate the suspicious object and/or the suspicious object reference chain by the server.
  • the object reference chain file of the exception object reported to the server may be in the following form.
  • Hprof file size is:72635717bytes
  • Chain 1 indicates that the image size of an advertisement splash screen is larger than 25MB, which is an abnormal object.
  • the relevant personnel on the server side can analyze and debug the relevant code according to the reference relationship of the picture.
  • the present invention focuses on large objects (for example, a long byte array) according to the long tail theory and actual conditions, and lists large objects as suspicious objects by acquiring
  • large objects for example, a long byte array
  • the suspicious objects in the heap data of the process and the chain of references to the suspicious objects can identify the cause of the excessive heap usage of the Java program.
  • FIG. 3 shows a flow chart of a memory analysis method in accordance with another embodiment of the present invention.
  • a plurality of determining steps may be optionally performed before performing step S370.
  • all the steps shown in FIG. 3 may be performed on the terminal device (which may be an Android terminal or other terminal), or one or more judgments as shown in FIG. 3 may be performed.
  • the steps and the order of execution between the plurality of decision steps shown in FIG. 3 have no substantial effect on the present invention.
  • an inquiry may be issued periodically to trigger a subsequent determination step.
  • a trigger condition for polling for example, it is possible to start timing after the terminal device switches to the background for more than 5 seconds, and then perform polling for more than 5 minutes.
  • step S320 it is determined whether the terminal device is in the lock screen state or the background running state. If the determination is yes, the next determination step may be continued, or step S370 may be directly executed. If the determination result is negative, the process returns to step S310.
  • step S330 it is determined whether the process to be monitored is a grayscale version. If the determination is yes, the next determination step may be continued, or step S370 may be directly executed. If the determination result is negative, the process returns to step S310.
  • step S340 it is determined whether the terminal device for executing the process to be monitored belongs to the target model. If the determination is yes, the next determination step may be continued, or step S370 may be directly performed. If the determination result is negative, the process returns to step S310.
  • step S350 it is determined whether the size of the heap data of the process to be monitored exceeds a corresponding threshold. If the determination is exceeded, the next determination step may be continued, or step S370 may be directly performed. If the determination result is negative, the process returns to step S310.
  • step S360 it is judged whether or not the memory image analysis processing (ie, step S370) is executed before the predetermined time threshold value is exceeded. If the determination is exceeded, the current memory image analysis processing can be executed. If the determination is not exceeded, the process returns to step S310. In this way, it is possible to prevent multiple memory image parsing processes from being performed for a short period of time (for example, within a few days).
  • step S370 a memory mirroring analysis process is performed.
  • the file flag can be marked with a file each time the memory mirror parsing process is executed, which can facilitate the execution of step S360.
  • the memory image parsing process can be performed in at least one of a plurality of cases described below:
  • the device for executing the process to be monitored belongs to a target model
  • FIG. 4 shows a schematic block diagram of the structure of a computing device in accordance with an embodiment of the present invention.
  • the computing device 400 of the present embodiment includes a memory 410 and a processor 420. Therein, computing device 400 is adapted to execute one or more processes.
  • the computing device 400 can be a mobile terminal device such as a mobile phone or an IPAD.
  • the memory 410 is used to store heap data corresponding to one or more processes executed by the computing device 400.
  • the processor 420 is configured to obtain a memory image file of the heap data of the process to be monitored, parse the memory image file, obtain object information of the predetermined type object, and object reference relationship, determine the suspicious object based on the object information, and generate the suspicious object based on the object reference relationship.
  • the object reference chain is configured to obtain a memory image file of the heap data of the process to be monitored, parse the memory image file, obtain object information of the predetermined type object, and object reference relationship, determine the suspicious object based on the object information, and generate the suspicious object based on the object reference relationship.
  • the computing device 400 of the present embodiment can also optionally include a communication device 430 that can upload an object reference chain of suspicious objects to a server.
  • the computing device 400 of the embodiment may also be implemented by the processor 420.
  • the schemes mentioned in FIG. 4 and not mentioned here are not described here.
  • FIG. 5 shows a schematic block diagram of the structure of a memory analysis system in accordance with an embodiment of the present invention.
  • the memory analysis system 500 of the present embodiment includes a computing device 400 and a server 510.
  • the server 510 can receive the object reference chain of the suspicious object uploaded by the computing device 400, and can perform anti-aliasing on the object reference chain of the suspicious object.
  • the method according to the invention can also be implemented as a computer program comprising computer program code instructions for performing the various steps defined above in the above method of the invention.
  • the method according to the invention may also be embodied as a computer program product comprising a computer readable medium on which is stored a computer for performing the above-described functions defined in the above method of the invention program.
  • a computer program product comprising a computer readable medium on which is stored a computer for performing the above-described functions defined in the above method of the invention program.
  • each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions.
  • the functions noted in the blocks may also occur in a different order than the ones in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种内存分析方法、装置、系统以及计算设备。其中,获取待监控进程的堆数据的内存镜像文件(S210),解析内存镜像文件,以获取预定类型对象的对象信息和对象引用关系(S220),基于对象信息确定可疑对象(S230),基于对象引用关系生成可疑对象的对象引用链(S240)。由此,针对Java程序的堆占用过大问题,按照长尾理论和实际情况,把分析重点放在大对象上面(例如很长的byte数组),将大对象列为可疑对象,通过获取进程的堆数据中的可疑对象以及可疑对象的引用链,可以找出导致Java程序的堆占用过大问题的原因所在。

Description

一种内存分析方法、装置、系统以及计算设备
本申请要求于2016年10月18日提交中国专利局、申请号为CN201610906023.8、发明名称为“一种内存分析方法、装置、系统以及计算设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机技术领域,具体涉及一种内存分析方法、装置、系统以及计算设备。
发明背景
在应用开发中,当JVM(Java程序运行所在的虚拟机)没有足够的内存来为对象分配空间并且垃圾回收器也已经没有空间可回收时,就会抛出OOM(out of memory)错误。
在Java程序中,由于存在垃圾自动回收机制,所以,一般不用去主动释放不用的对象所占的内存,也就是从理论上来说,是不会存在OOM错误的。但是,如果编码不当,比如,将某个对象的引用放到了全局的Map中,虽然方法结束了,但是由于垃圾回收器会根据对象的引用情况来回收内存,导致该对象不能被及时的回收,使得该对象持续占据内存,容易导致内存不足,进而引发OOM。例如,对于图片缓存,图片往往能够达到10MB以上,而堆空间一般只有200MB,如果图片被展现后没有解除引用关系并回收,那么该图片就会一直占据内存。
因此,在出现OOM错误时,我们希望知道在这个时间点上,到底什么对象占据了该JVM的堆,而现在我们无法准确的获知堆内存消耗异常时刻的对象分布情况。另外,如果在进程的堆内存消耗异常时,我们能够有效地确定此时堆内存中的异常对象的分布情况,也可以有效地避免OOM错误的发生。
由此,需要一种能够有效确定堆内存消耗异常时刻的异常对象的分布情况的内存分析方案。
发明内容
本发明主要解决的技术问题是提供一种内存分析方法、装置、系统以及计算设备,其能够有效地确定堆内存消耗异常时刻的对象分布情况。
根据本发明的一个方面,提供了一种内存分析方法,包括内存镜像解析处理,内存镜像解析处理包括:获取待监控进程的堆数据的内存镜像文件;解析内存镜像文件,以获取预定类型对象的对象信息和对象引用关系;以及基于对象信息确定可疑对象;以及基于对象引用关系生成可疑对象的对象引用链。
由此,通过对待监控进程的堆数据的内存镜像文件进行解析处理,可以得到其中的对象信息和对象引用关系,从而可以从中分析出可疑对象以及可疑对象的对象引用链。这里,可疑对象可以是大小超过预定阈值的对象。
优选地,基于对象信息确定可疑对象的步骤可以包括:确定尺寸最大的一个或多个对象为可疑对象;或者确定尺寸大于第一预定阈值的对象为可疑对象。
由于导致OOM错误的对象一般是尺寸较大的对象,因此,可以将尺寸较大的一个或多个对象作为可疑对象。
优选地,解析内存镜像文件的步骤可以包括:通过拓扑排序算法计算对象支配树,以得到对象引用关系。
优选地,在解析内存镜像文件的步骤中,可以只获取尺寸大于第二预定阈值的预定类型对象的对象信息和对象引用关系,第二预定阈值小于或等于第一预定阈值。
由此,可以获取内存镜像文件中部分对象信息和对象引用关系,这样,可以减小工作量,提高内存分析效率。
优选地,该内存分析方法还可以包括:将可疑对象的对象引用链上传到服务器。
优选地,该内存分析方法还可以包括:由服务器对可疑对象的对象引用链进行反混淆处理。
优选地,所述内存镜像解析处理在以下所述的其中至少一种情况下执行:在用于执行待监控进程的设备当前处于锁屏状态的情况下;在待监控进程处于后台运行状态的情况下;在待监控进程为灰度版本的情况下;在用于执行待监 控进程的设备属于目标机型的情况下;在待监控进程的堆数据的尺寸超过第三预定阈值的情况下;在距上次执行内存镜像解析处理超过预定时间阈值的情况下。
由此,本发明的内存分析方法可以用在执行一个或多个进程的终端设备上,在执行内存分析方法中的内存镜像解析处理之前,还可以判断当前设备是否符合预定的条件,在符合预定的条件的情况下,再执行内存镜像解析处理。
根据本发明的另一个方面,还提供了一种内存分析装置,包括内存镜像解析处理模块,内存镜像解析处理模块包括:获取单元,用于获取待监控进程的堆数据的内存镜像文件;解析单元,用于解析内存镜像文件,以获取预定类型对象的对象信息和对象引用关系;可疑对象确定单元,用于基于对象信息确定可疑对象;对象引用链生成单元,基于对象引用关系生成可疑对象的对象引用链。
优选地,解析单元可以通过拓扑排序算法计算对象支配树,以得到对象引用关系。
优选地,该内存分析装置还可以包括:上传单元,用于将可疑对象的对象引用链上传到服务器。
优选地,所述可疑对象确定单元基于所述对象信息确定可疑对象的方式包括:
确定尺寸最大的一个或多个对象为可疑对象;或者
确定尺寸大于第一预定阈值的对象为可疑对象。
优选地,所述解析单元获取尺寸大于第二预定阈值的预定类型对象的对象信息和对象引用关系,所述第二预定阈值小于或等于第一预定阈值。
优选地,所述内存镜像解析处理模块以下所述的其中至少一种情况下执行所述内存镜像解析处理:在用于执行待监控进程的设备当前处于锁屏状态的情况下;在待监控进程处于后台运行状态的情况下;在待监控进程为灰度版本的情况下;并且/或者在用于执行待监控进程的设备属于目标机型的情况下;在待监控进程的堆数据的尺寸超过第三预定阈值的情况下;在距上次执行内存镜像解析处理超过预定时间阈值的情况下。
根据本发明的另一个方面,还提供了一种计算设备,该计算设备包括:内存,用于存储一种或多种进程所对应的堆数据;以及处理器,用于获取待监控 进程的堆数据的内存镜像文件,解析内存镜像文件,以获取预定类型对象的对象信息和对象引用关系,基于对象信息确定可疑对象,并基于对象引用关系生成可疑对象的对象引用链。
优选地,该计算设备还可以包括:通信装置,用于将可疑对象的对象引用链上传到服务器。
根据本发明的另一个方面,还提供了一种内存分析系统,包括计算设备和服务器,其中:
所述计算设备包括:内存及通信装置,所述内存用于存储一种或多种进程所对应的堆数据,所述通信装置用于将所述可疑对象的对象引用链上传到服务器;
处理器,用于获取待监控进程的堆数据的内存镜像文件,解析所述内存镜像文件,以获取预定类型对象的对象信息和对象引用关系,基于所述对象信息确定可疑对象,并基于所述对象引用关系生成所述可疑对象的对象引用链;以及
所述服务器,用于对所述可疑对象的对象引用链进行反混淆处理。
综上,针对Java程序的堆占用过大问题,本发明按照长尾理论和实际情况,把分析重点放在大对象上面(例如很长的byte数组),将大对象列为可疑对象,通过获取进程的堆数据中的可疑对象以及可疑对象的引用链,可以找出导致Java程序的堆占用过大问题的原因所在。
附图说明
通过结合附图对本公开示例性实施方式进行更详细的描述,本公开的上述以及其它目的、特征和优势将变得更加明显,其中,在本公开示例性实施方式中,相同的参考标号通常代表相同部件。
图1示出了根据本发明一实施例的内存分析装置的结构的示意性方框图。
图2示出了根据本发明一实施例的内存分析方法的示意性流程图。
图3示出了根据本发明另一实施例的内存分析方法的示意性流程图。
图4示出了根据本发明一实施例的计算设备的结构的示意性方框图。
图5示出了根据本发明一实施例的内存分析系统的结构的示意性方框图。
具体实施方式
下面将参照附图更详细地描述本公开的优选实施方式。虽然附图中显示了本公开的优选实施方式,然而应该理解,可以以各种形式实现本公开而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了使本公开更加透彻和完整,并且能够将本公开的范围完整地传达给本领域的技术人员。
在描述本发明之前,首先对本发明涉及的几个概念做以简要说明。
内存镜像:进程的堆信息。
Hprof文件:获取的内存镜像的文件,Hprof为文件名后缀。
JVM:Java程序运行所在的虚拟机。
OOM:Java语言中的Out Of Memory Error,因为堆的空间被耗尽,导致程序无法再申请到对象所需的内存,导致的崩溃。
如前文所述,针对OOM错误,本发明提供了一种能确定JVM的堆数据中的异常对象及异常对象的引用关系的内存分析方案,基于本发明的方案,可以清楚地了解到可能导致OOM错误的可疑对象的分布情况。
图1示出了根据本发明一实施例的内存分析装置的结构的示意性方框图。
图2示出了根据本发明一实施例的内存分析方法的示意性流程图。
参见图1,本实施例的内存分析装置包括内存镜像解析处理模块100。内存镜像解析处理模块100包括获取单元110、解析单元120、可疑对象确定单元130以及对象引用链生成单元140。
参见图2,本实施例的内存分析方法包括内存镜像解析处理200,内存镜像解析处理200可以由内存镜像解析处理模块100实现。其中,内存镜像解析处理200的全部步骤或大部分步骤可以在运行待监控进程的终端设备上进行,这里的终端设备可以是安卓设备,也可以是其它设备。
在执行内存镜像解析处理200之前,可以扩大分配给用于执行内存镜像解析处理200的进程(可以称为Hprof进程)的堆内存的最大值。这样,可以避免在执行内存镜像解析处理200的过程中因内存不足而导致不能正常执行的情况发生。
另外,在执行内存镜像解析处理200之前,还可以判断内存镜像解析处理200所对应的Intent的合理性。例如,可以根据Intent的描述,找到对应的组 件,并将Intent传递给调用的组件,并完成组件的调用。
下面结合图1、图2详细说明内存镜像解析处理200的实现过程。
在步骤S210,例如可以由获取单元110,获取待监控进程的堆数据的内存镜像文件。
这里根据运行待监控进程的设备和具体情况,可以选取相应的方式来获取内存镜文件。
例如,可以使用可seek寻址,position递进的文件读取接口读取内存镜像文件。具体来说,可以使用系统接口Debug.dumpHprofData()获取内存镜像的hprof文件,然后可以将hprof文件解析出来,这里可以主要解析出结构化的GCRoot/ArrayInstance/Class/ClassObject/Thread等类型的对象信息,并可以将其保存在Map或Collection里面。
其中,在执行步骤S210之前或执行步骤S210的过程中,可以锁定待监控进程的堆数据,使得待监控进程无法对堆数据进行操作。这样,可以防止在执行本发明的分析方案的过程中堆数据被修改(这里的修改可以是堆数据本身的修改,也可以是引用关系的修改)。
在步骤S220,例如可以由解析单元120,解析内存镜像文件,以获取预定类型对象的对象信息和对象引用关系。
由于导致OOM错误的对象一般是大对象,因此这里可以优选地将尺寸能够大于第一预定阈值的类型对象作为预定类型对象,然后获取预定类型对象的对象信息和对象引用关系。例如,预定类型对象可以是图片(Bitmap)、byte[]等可能会具有较大尺寸的类型对象。
其中,可以通过拓扑排序算法计算对象支配树,来得到对象引用关系。这里,可以从GC ROOT(内存回收根节点)出发,建立所有对象的树形依赖引用关系(即对象支配树)。在建立对象的对象支配树时,可以在不计算retained size的情况下计算对象的树形依赖引用关系,也就是说在计算对象的对象支配树时,可以仅计算对象本身所占用的空间(shallow size)。其中,retained size是该对象自己的尺寸(即shallow size),加上从该对象能直接或间接访问到对象的shallow size之和。换句话说,retained size是该对象被GC(垃圾回收)之后所能回收到内存的总和。shallow size就是对象本身占用内存的大小,不包含其引用的对象。
在步骤S230,例如可以由可疑对象确定单元130,基于对象信息确定可疑对象。
在获取了对象信息后,可以将尺寸较大的对象信息认为是可疑对象。这里可以确定尺寸最大的一个或多个对象为可疑对象,或者,也可以确定尺寸大于第一预定阈值的对象为可疑对象。例如,可以将第一预定阈值设为20M,然后可以将尺寸大于20M的对象确定为可疑对象。
其中,对于上文在步骤S220中述及的解析内存镜像文件的步骤,可以只获取尺寸大于第二预定阈值的预定类型对象的对象信息和对象引用关系,这里,第二预定阈值小于或等于第一预定阈值。例如,第二预定阈值可以设定为1M,第一预定阈值可以设定为10M。
在步骤S240,例如可以由对象引用链生成单元140,基于对象引用关系生成可疑对象的对象引用链。
根据所确定的可疑对象以及对象引用关系,可以得出可疑对象的对象引用链。
对于得出的可疑对象和/或可疑对象引用链,可以将其上传到服务器(这里,可以将可疑对象引用链转化为JSON字符串(也可以是文本文件),然后通过相关组件(例如,可以是CrashSDK)上传给服务器),由服务器进行展示指出实际运行中的可疑对象,以供服务器端的相关人员根据所展示的可疑对象以及可疑对象的引用关系做进一步处理。
由于内存镜像里面所包含的类名字符串是被混淆处理后的(例如MainUIControllor的类名被混淆处理后变为a),并且不同版本的待监控进程的内存镜像文件不一样。因此,服务器在接收到可疑对象和/或可疑对象引用链后,可以由服务器对可疑对象和/或可疑对象引用链进行反混淆处理。
其中,上报给服务器的异常对象的对象引用链文件可以是如下形式。
Max JVM Heap:134217728
Device Screen Width&Height:1080,1920
Device Manufacturer:Xiaomi
IMEI:866963021720281
Hprof file size is:72635717bytes
The reference chain of objects,which are big enough for our attention.(byte[]&&char[]only..)
Chain 0:
[TerminalNode]  Class:byte[],SIZE:980640
[ReferenceNode]  Class:android.graphics.Bitmap,SIZE:47
[ReferenceNode]  Class:android.graphics.drawable.BitmapDrawable$BitmapState,SIZE:54
[ReferenceNode]  Class:android.graphics.drawable.BitmapDrawable,SIZE:68
[ReferenceNode]  Class:com.uc.browser.core.homepage.weather.view.WeatherWidgetEx,SIZE:892
[GCRootNode]  Class:default,SIZE:165
Chain 1:
[TerminalNode]  Class:byte[],SIZE:26645760
[ReferenceNode]  Class:android.graphics.Bitmap,SIZE:47
[ReferenceNode]  Class:com.uc.browser.advertisement.afp.model.data.AFPMedia,SIZE:40
[ReferenceNode]  Class:com.uc.browser.advertisement.afp.model.data.AFPCreative,SIZE:56
[ReferenceNode]  Class:com.uc.browser.splashscreen.SplashHCAdHelper,SIZE:17
[GCRootNode]  Class:default,SIZE:144
如上所示,Chain 1表明某个广告闪屏的图片尺寸大于25MB,属于异常对象。此时,服务器端的相关人员就可以根据该图片的引用关系对相关代码进行分析、调试。
综上,针对Java程序的堆占用过大问题,本发明按照长尾理论和实际情况,把分析重点放在大对象上面(例如很长的byte数组),将大对象列为可疑对象,通过获取进程的堆数据中的可疑对象以及可疑对象的引用链,可以找出导致Java程序的堆占用过大问题的原因所在。
例如,我们可以首先找到尺寸超过20MB的图片,然后确定图片的对象引用链,比如我们如果知道了是主界面的UIControllor类持有了一个Dialog对话框类,这个对话框又持有了这个20MB的图片,由此就找到了问题所在。开发人员可以通过调整相应代码,从而解决Java程序的堆占用过大问题,这样,可以避免OOM错误的产生。或者,在产生OOM错误时,利用本发明也可以有效地解决OOM错误。
图3示出了根据本发明另一实施例的内存分析方法的流程图。
如图3所示,在执行步骤S370之前,可以可选地执行多个判断步骤(步骤S310-步骤S360)。其中,可以在终端设备(可以是安卓终端,也可以是其它终端)上执行图3所示的所有步骤,也可以执行图3所示的一个或多个判断 步骤,并且图3所示的多个判断步骤之间的执行顺序对本发明并无实质性影响。
参见图3,在步骤S310,可以定期发出询问,以触发后续的判断步骤。这里,还可以设定一个轮询的触发条件,例如,可以在终端设备切换至后台超过5秒开始计时,然后超过5分钟进行一次轮询。
在步骤S320,判断终端设备是否是锁屏状态或后台运行状态,在判定为是的情况下,可以继续执行下一个判断步骤,或者也可以直接执行步骤S370。在判定结果为否的情况下,可以返回步骤S310。
在步骤S330,判断待监控进程是否为灰度版本,在判定为是的情况下,可以继续执行下一个判断步骤,或者也可以直接执行步骤S370。在判定结果为否的情况下,可以返回步骤S310。
在步骤S340,判断用于执行待监控进程的终端设备是否属于目标机型,在判定为是的情况下,可以继续执行下一个判断步骤,或者也可以直接执行步骤S370。在判定结果为否的情况下,可以返回步骤S310。
在步骤S350,判断待监控进程的堆数据的尺寸是否超过对应阈值,在判定超过的情况下,可以继续执行下一个判断步骤,或者也可以直接执行步骤S370。在判定结果为否的情况下,可以返回步骤S310。
在步骤S360,判断距上次执行内存镜像解析处理(即步骤S370)是否超过预定时间阈值,在判定超过的情况下,可以执行本次内存镜像解析处理。在判定未超过的情况下,可以返回步骤S310。这样,可以防止短时间内(例如几天内)做多次内存镜像解析处理。
在步骤S370,执行内存镜像解析处理。
其中,内存镜像解析处理的过程可以参见上文相关描述,这里不再赘述。需要说明的是,在每次执行内存镜像解析处理时可以用一个文件做标记flag,这样可以便于步骤S360的执行。
根据上述步骤S310-S370的描述,可以理解的是,所述内存镜像解析处理可以在以下所述的多种情况的其中至少一种情况下执行:
在用于执行所述待监控进程的设备当前处于锁屏状态的情况下;
在所述待监控进程处于后台运行状态的情况下;在所述待监控进程为灰度版本的情况下;
在用于执行所述待监控进程的设备属于目标机型的情况下;
在所述待监控进程的堆数据的尺寸超过第三预定阈值的情况下;
在距上次执行所述内存镜像解析处理超过预定时间阈值的情况下。
图4示出了根据本发明一实施例的计算设备的结构的示意性方框图。
参见图4,本实施例的计算设备400包括内存410和处理器420。其中,计算设备400适于执行一种或多种进程。这里,计算设备400可以是手机、IPAD等移动终端设备。
内存410用于存储计算设备400所执行的一种或多种进程所对应的堆数据。
处理器420用于获取待监控进程的堆数据的内存镜像文件,解析内存镜像文件,以获取预定类型对象的对象信息和对象引用关系,基于对象信息确定可疑对象,并基于对象引用关系生成可疑对象的对象引用链。
参见图4,本实施例的计算设备400还可以可选地包括通信装置430,通信装置430可以将可疑对象的对象引用链上传到服务器。
其中,本实施例涉及的内容在上文结合图1-图4已做了详细说明,可参上文相关描述,另外,本实施例的计算设备400还可以通过处理器420实现在上文结合图1-图4述及的而在这里没有提及的方案,此处不再赘述。
图5示出了根据本发明一实施例的内存分析系统的结构的示意性方框图。
参见图5,本实施例的内存分析系统500包括计算设备400和服务器510。
其中,计算设备400可参见图5的描述,这里不再赘述。
服务器510可以接收计算设备400上传的可疑对象的对象引用链,并可以对可疑对象的对象引用链进行反混淆处理。
上文中已经参考附图详细描述了根据本发明的内存分析方法、装置、系统以及计算设备。
此外,根据本发明的方法还可以实现为一种计算机程序,该计算机程序包括用于执行本发明的上述方法中限定的上述各步骤的计算机程序代码指令。或者,根据本发明的方法还可以实现为一种计算机程序产品,该计算机程序产品包括计算机可读介质,在该计算机可读介质上存储有用于执行本发明的上述方法中限定的上述功能的计算机程序。本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子 硬件、计算机软件或两者的组合。
附图中的流程图和框图显示了根据本发明的多个实施例的系统和方法的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标记的功能也可以以不同于附图中所标记的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
以上已经描述了本发明的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (16)

  1. 一种计算设备,其特征在于,该计算设备包括:
    内存,用于存储一种或多种进程所对应的堆数据;以及
    处理器,用于获取待监控进程的堆数据的内存镜像文件,解析所述内存镜像文件,以获取预定类型对象的对象信息和对象引用关系,基于所述对象信息确定可疑对象,并基于所述对象引用关系生成所述可疑对象的对象引用链。
  2. 根据权利要求1所述的计算设备,其特征在于,还包括:
    通信装置,用于将所述可疑对象的对象引用链上传到服务器。
  3. 一种内存分析系统,其特征在于,包括计算设备和服务器,其中:
    所述计算设备包括:内存及通信装置,所述内存用于存储一种或多种进程所对应的堆数据,所述通信装置用于将所述可疑对象的对象引用链上传到服务器;
    处理器,用于获取待监控进程的堆数据的内存镜像文件,解析所述内存镜像文件,以获取预定类型对象的对象信息和对象引用关系,基于所述对象信息确定可疑对象,并基于所述对象引用关系生成所述可疑对象的对象引用链;以及
    所述服务器,用于对所述可疑对象的对象引用链进行反混淆处理。
  4. 一种内存分析装置,其特征在于,包括内存镜像解析处理模块,所述内存镜像解析处理模块包括:
    获取单元,用于获取待监控进程的堆数据的内存镜像文件;
    解析单元,用于解析所述内存镜像文件,以获取预定类型对象的对象信息和对象引用关系;
    可疑对象确定单元,用于基于所述对象信息确定可疑对象;
    对象引用链生成单元,基于所述对象引用关系生成所述可疑对象的对象引用链。
  5. 根据权利要求4所述的内存分析装置,其特征在于,所述解析单元通 过拓扑排序算法计算对象支配树,以得到所述对象引用关系。
  6. 根据权利要求4所述的内存分析装置,其特征在于,还包括:
    上传单元,用于将所述可疑对象的对象引用链上传到服务器。
  7. 根据权利要求4所述的内存分析装置,其特征在于,所述可疑对象确定单元基于所述对象信息确定可疑对象的方式包括:
    确定尺寸最大的一个或多个对象为可疑对象;或者
    确定尺寸大于第一预定阈值的对象为可疑对象。
  8. 根据权利要求7所述的内存分析装置,其特征在于,所述解析单元获取尺寸大于第二预定阈值的预定类型对象的对象信息和对象引用关系,所述第二预定阈值小于或等于第一预定阈值。
  9. 根据权利要求4-8中任意一项所述的内存分析装置,其特征在于,所述内存镜像解析处理模块在以下所述的其中至少一种情况下执行所述内存镜像解析处理:
    在用于执行所述待监控进程的设备当前处于锁屏状态的情况下;
    在所述待监控进程处于后台运行状态的情况下;
    在所述待监控进程为灰度版本的情况下;
    在用于执行所述待监控进程的设备属于目标机型的情况下;
    在所述待监控进程的堆数据的尺寸超过第三预定阈值的情况下;在距上次执行所述内存镜像解析处理超过预定时间阈值的情况下。
  10. 一种内存分析方法,其特征在于,包括内存镜像解析处理,所述内存镜像解析处理包括:
    获取待监控进程的堆数据的内存镜像文件;
    解析所述内存镜像文件,以获取预定类型对象的对象信息和对象引用关系;以及
    基于所述对象信息确定可疑对象;以及
    基于所述对象引用关系生成所述可疑对象的对象引用链。
  11. 根据权利要求10所述的内存分析方法,其特征在于,基于所述对象信息确定可疑对象的步骤包括:
    确定尺寸最大的一个或多个对象为可疑对象;或者
    确定尺寸大于第一预定阈值的对象为可疑对象。
  12. 根据权利要求10所述的内存分析方法,其特征在于,解析所述内存镜像文件的步骤包括:
    通过拓扑排序算法计算对象支配树,以得到所述对象引用关系。
  13. 根据权利要求11所述的内存分析方法,其特征在于,
    在解析所述内存镜像文件的步骤中,只获取尺寸大于第二预定阈值的预定类型对象的对象信息和对象引用关系,所述第二预定阈值小于或等于第一预定阈值。
  14. 根据权利要求10所述的内存分析方法,其特征在于,还包括:
    将所述可疑对象的对象引用链上传到服务器。
  15. 根据权利要求14所述的内存分析方法,其特征在于,还包括:
    由所述服务器对所述可疑对象的对象引用链进行反混淆处理。
  16. 根据权利要求10-15中任意一项中所述的内存分析方法,其特征在于,所述内存镜像解析处理在以下所述的其中至少一种情况下执行:
    在用于执行所述待监控进程的设备当前处于锁屏状态的情况下;
    在所述待监控进程处于后台运行状态的情况下;
    在所述待监控进程为灰度版本的情况下;
    在用于执行所述待监控进程的设备属于目标机型的情况下;
    在所述待监控进程的堆数据的尺寸超过第三预定阈值的情况下;
    在距上次执行所述内存镜像解析处理超过预定时间阈值的情况下。
PCT/CN2017/080261 2016-10-18 2017-04-12 一种内存分析方法、装置、系统以及计算设备 WO2018072408A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610906023.8 2016-10-18
CN201610906023.8A CN107967205B (zh) 2016-10-18 2016-10-18 一种内存分析方法、装置、系统以及计算设备

Publications (1)

Publication Number Publication Date
WO2018072408A1 true WO2018072408A1 (zh) 2018-04-26

Family

ID=61996825

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/080261 WO2018072408A1 (zh) 2016-10-18 2017-04-12 一种内存分析方法、装置、系统以及计算设备

Country Status (2)

Country Link
CN (1) CN107967205B (zh)
WO (1) WO2018072408A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858339A (zh) * 2020-07-22 2020-10-30 腾讯科技(成都)有限公司 内存分析方法、设备和系统以及计算设备、计算机可读存储介质
CN112835813A (zh) * 2021-03-04 2021-05-25 腾讯音乐娱乐科技(深圳)有限公司 处理内存中重复图片的方法、电子设备及存储介质
CN113094178A (zh) * 2021-04-23 2021-07-09 北京字节跳动网络技术有限公司 内存镜像文件生成方法、装置、电子设备和存储介质
CN114090965A (zh) * 2021-11-22 2022-02-25 全景智联(武汉)科技有限公司 java代码混淆方法、系统、计算机设备及存储介质
CN114546590A (zh) * 2022-02-18 2022-05-27 北京基调网络股份有限公司 Java虚拟机堆内存集合对象监测方法及内存溢出分析方法

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110543358A (zh) * 2018-05-29 2019-12-06 北京京东尚科信息技术有限公司 图片还原方法和装置
CN109189374B (zh) * 2018-06-22 2020-08-28 北京大学 基于对象引用链的对象构造代码生成方法及系统
CN109408383B (zh) * 2018-10-12 2023-04-14 北京宝兰德软件股份有限公司 一种Java内存泄漏分析方法及装置
CN109558297A (zh) * 2018-11-27 2019-04-02 苏州思必驰信息科技有限公司 内存管理方法及装置
CN111274082B (zh) * 2020-01-13 2023-04-18 北京字节跳动网络技术有限公司 一种内存性能的分析方法、装置、介质和电子设备
CN111858068A (zh) * 2020-07-31 2020-10-30 重庆紫光华山智安科技有限公司 一种Java程序性能问题定位方法及装置
CN112181830B (zh) * 2020-09-28 2022-08-09 厦门美柚股份有限公司 内存泄露的检测方法、装置、终端及介质
CN112711629B (zh) * 2020-12-30 2022-10-21 浙江中控技术股份有限公司 数据及关联数据导入导出方法、装置、设备及存储介质
CN113391882B (zh) * 2021-06-28 2023-12-22 北京字节跳动网络技术有限公司 虚拟机内存管理方法、装置、存储介质及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1221912A (zh) * 1997-12-09 1999-07-07 太阳微系统有限公司 用于发现内存泄漏和运行期信息的对象堆分析技术
CN101046755A (zh) * 2006-03-28 2007-10-03 郭明南 一种计算机自动内存管理的系统及方法
CN101493767A (zh) * 2009-01-20 2009-07-29 中国科学技术大学 一种即时编译器辅助的垃圾收集中显式释放对象的插桩方法
CN103425532A (zh) * 2013-08-27 2013-12-04 北京京东尚科信息技术有限公司 一种java无状态对象的管理方法和装置
CN104808985A (zh) * 2015-04-02 2015-07-29 小米科技有限责任公司 应用程序中对象的管理方法及装置
CN104866764A (zh) * 2015-06-02 2015-08-26 哈尔滨工业大学 一种基于对象引用图的Android手机恶意软件检测方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1221912A (zh) * 1997-12-09 1999-07-07 太阳微系统有限公司 用于发现内存泄漏和运行期信息的对象堆分析技术
CN101046755A (zh) * 2006-03-28 2007-10-03 郭明南 一种计算机自动内存管理的系统及方法
CN101493767A (zh) * 2009-01-20 2009-07-29 中国科学技术大学 一种即时编译器辅助的垃圾收集中显式释放对象的插桩方法
CN103425532A (zh) * 2013-08-27 2013-12-04 北京京东尚科信息技术有限公司 一种java无状态对象的管理方法和装置
CN104808985A (zh) * 2015-04-02 2015-07-29 小米科技有限责任公司 应用程序中对象的管理方法及装置
CN104866764A (zh) * 2015-06-02 2015-08-26 哈尔滨工业大学 一种基于对象引用图的Android手机恶意软件检测方法

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858339A (zh) * 2020-07-22 2020-10-30 腾讯科技(成都)有限公司 内存分析方法、设备和系统以及计算设备、计算机可读存储介质
CN111858339B (zh) * 2020-07-22 2023-11-28 腾讯科技(成都)有限公司 内存分析方法、设备和系统以及计算设备、计算机可读存储介质
CN112835813A (zh) * 2021-03-04 2021-05-25 腾讯音乐娱乐科技(深圳)有限公司 处理内存中重复图片的方法、电子设备及存储介质
CN113094178A (zh) * 2021-04-23 2021-07-09 北京字节跳动网络技术有限公司 内存镜像文件生成方法、装置、电子设备和存储介质
CN114090965A (zh) * 2021-11-22 2022-02-25 全景智联(武汉)科技有限公司 java代码混淆方法、系统、计算机设备及存储介质
CN114090965B (zh) * 2021-11-22 2024-05-17 全景智联(武汉)科技有限公司 java代码混淆方法、系统、计算机设备及存储介质
CN114546590A (zh) * 2022-02-18 2022-05-27 北京基调网络股份有限公司 Java虚拟机堆内存集合对象监测方法及内存溢出分析方法

Also Published As

Publication number Publication date
CN107967205B (zh) 2020-12-29
CN107967205A (zh) 2018-04-27

Similar Documents

Publication Publication Date Title
WO2018072408A1 (zh) 一种内存分析方法、装置、系统以及计算设备
US8473789B2 (en) Memory leak monitoring system and associated methods
US8990642B2 (en) Managing error logs in a distributed network fabric
US8832666B2 (en) Dynamic instrumentation
US9430355B2 (en) System diagnostics with thread dump analysis
US10324784B2 (en) Mitigating crashes of an application server executing a monitoring agent
CN106980533B (zh) 基于异构处理器的任务调度方法、装置及电子设备
US9471383B2 (en) Task allocation in a computing environment
CN110716848A (zh) 数据收集方法、装置、电子设备及存储介质
KR20140019413A (ko) 메모리 관리를 위한 보존 가비지 콜렉팅 및 정수 태깅
CN112434308A (zh) 应用漏洞检测方法、装置、电子设备及计算机存储介质
CN111371585A (zh) 用于cdn节点的配置方法及装置
CN109246234B (zh) 一种镜像文件下载方法、装置、电子设备及存储介质
CN110597688A (zh) 监控信息采集方法及系统
CN107256167B (zh) 应用于应用系统迁移的升级控制方法及升级控制设备
US9251028B2 (en) Managing code instrumentation in a production computer program
CN110231921B (zh) 日志打印方法、装置、设备及计算机可读存储介质
JP2009217617A (ja) メモリリーク箇所の特定方法及び装置
CN116339908A (zh) 虚拟机启动方法、装置、计算机设备和存储介质
CN113064765B (zh) 节点异常处理方法、装置、电子设备及机器可读存储介质
CN109343953B (zh) 内存管理方法、装置及电子设备
CN113297149A (zh) 数据处理请求的监测方法及装置
CN111240956A (zh) 内存泄漏监测方法、装置、电子设备及计算机存储介质
CN115705294B (zh) 用于获取函数调用信息的方法、装置、电子设备和介质
CN117135151B (zh) 一种gpu集群的故障检测方法及gpu集群、电子设备和存储介质

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: 17862882

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: 17862882

Country of ref document: EP

Kind code of ref document: A1