CN111274082B - Memory performance analysis method, device, medium and electronic equipment - Google Patents

Memory performance analysis method, device, medium and electronic equipment Download PDF

Info

Publication number
CN111274082B
CN111274082B CN202010032133.2A CN202010032133A CN111274082B CN 111274082 B CN111274082 B CN 111274082B CN 202010032133 A CN202010032133 A CN 202010032133A CN 111274082 B CN111274082 B CN 111274082B
Authority
CN
China
Prior art keywords
reference chain
chain information
information
fragment
analysis
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010032133.2A
Other languages
Chinese (zh)
Other versions
CN111274082A (en
Inventor
刘昭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010032133.2A priority Critical patent/CN111274082B/en
Publication of CN111274082A publication Critical patent/CN111274082A/en
Application granted granted Critical
Publication of CN111274082B publication Critical patent/CN111274082B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02WCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO WASTEWATER TREATMENT OR WASTE MANAGEMENT
    • Y02W90/00Enabling technologies or technologies with a potential or indirect contribution to greenhouse gas [GHG] emissions mitigation

Abstract

The invention provides a method, a device, a medium and electronic equipment for analyzing memory performance, wherein the method comprises the following steps: analyzing the memory snapshot at the computer end, analyzing the storage information in the memory snapshot and obtaining a corresponding analysis result; and splicing according to the reference chain information corresponding to the active objects and/or the fragment objects in the analysis result to obtain corresponding hypertext markup language files. Assembling the reference chain information corresponding to the active object and/or the fragment object in the analysis result to obtain a corresponding hypertext markup language file; the reference chain information comprises first reference chain information corresponding to any one movable object and second reference chain information corresponding to any one fragment object; therefore, intrusion codes do not need to be introduced in the process of analyzing the memory performance of the application program, for example, the memory leakage problem of the application program is analyzed, the detection range is comprehensive, the detection efficiency is improved, and extra memory overflow is not generated.

Description

Memory performance analysis method, device, medium and electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, a medium and electronic equipment for analyzing memory performance.
Background
The existing application program often needs to occupy a large amount of memory during running, so that the problem of large memory occupation is easily caused.
In practical applications, if the memory is not used properly, the process of the application program is not crashed immediately, but has a long latency period. The memory problem is caused by many reasons, for example, the memory problem is often difficult to locate due to the influence of the path depth or the influence of the interaction mode.
The process of memory leakage is monitored through the LeakCanary library, and the reason of the memory leakage is analyzed through the LeakCanary library. However, the problems of the existing leakcarary library are many, which are specifically as follows:
the prior art analyzes and processes the memory performance as follows:
step a1, an application program accesses to a LeakCanary library.
Step a2, registering activity and fragment life cycle call-back.
And a step a3, detecting whether the object is recycled or not in the runtime.
And a4, unloading the memory snapshot.
And step a5, starting a new process.
Step a6: analysis of the object reference chains was performed.
And a step a7, if the analysis result exists, popping up a notice.
The above-mentioned memory performance analysis and processing processes have the following problems:
problem 1: the product must be accessed into a LeakCanary library to be used offline. If no bring-to-line is desired, an additional branch or packing configuration needs to be maintained.
Problem 2: the process of analyzing the memory performance through the LeakCanary library is executed at the mobile phone end. The mobile phone terminal runs the process of analyzing the memory performance through the LeakCanary library, so that the running speed is low, a central processing unit is consumed, and other modules of the mobile phone terminal are influenced.
Problem 3: in the process of analyzing the memory performance through the leak bank at one time, even if other leakage problems are monitored, other monitored leakage problems cannot be analyzed, and only one leakage can be analyzed at one time, so that the phenomenon of report missing easily exists in the process of analyzing the memory performance.
Problem 4: at the mobile phone end, the abnormal phenomenon of memory overflow can occur at the mobile phone end through the process of analyzing the memory performance by the LeakCanary library.
Disclosure of Invention
The present invention is directed to a method, an apparatus, a medium, and an electronic device for analyzing memory performance, which can solve at least one of the above-mentioned problems. The specific scheme is as follows:
according to a specific embodiment of the present invention, in a first aspect, the present invention provides a method for analyzing memory performance, including:
starting an analysis process for performing performance analysis on the memory performance in a plug-in mode conforming to a preset plug-in format at a computer end;
unloading the memory snapshot and pulling the memory snapshot to the computer end;
analyzing the memory snapshot at the computer terminal, and analyzing the storage information in the memory snapshot to obtain a corresponding analysis result;
assembling according to the reference chain information corresponding to the active objects and/or the fragment objects in the analysis result to obtain corresponding hypertext markup language files; the reference chain information comprises first reference chain information corresponding to any one movable object and second reference chain information corresponding to any one fragment object.
According to a second aspect of the present invention, there is provided an apparatus for analyzing memory performance, including:
the starting unit is used for starting and running an analysis process for analyzing the memory performance in a plug-in mode conforming to a preset plug-in format at the computer end;
the processing unit is used for unloading the memory snapshot and pulling the memory snapshot to the computer end;
the analysis unit is used for analyzing the memory snapshot processed by the processing unit at the computer terminal, analyzing the storage information in the memory snapshot and obtaining a corresponding analysis result;
the assembling unit is used for assembling according to the reference chain information corresponding to the movable object and/or the fragment object in the analysis result analyzed by the analyzing unit to obtain a corresponding hypertext markup language file; the reference chain information comprises first reference chain information corresponding to any one movable object and second reference chain information corresponding to any one fragment object.
According to a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the memory performance analysis method as defined in any one of the above.
According to a fourth aspect of the present invention, there is provided an electronic apparatus including: one or more processors; a storage device for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the memory performance analysis method as described in any one of the above.
Compared with the prior art, the scheme of the embodiment of the invention at least has the following beneficial effects: the embodiment of the invention provides a memory performance analysis method, a memory performance analysis device, a memory performance analysis medium and electronic equipment, wherein reference chain information corresponding to active objects and/or fragment objects in an analysis result is spliced to obtain corresponding hypertext markup language files; the reference chain information comprises first reference chain information corresponding to any one movable object and second reference chain information corresponding to any one fragment object; therefore, intrusion codes do not need to be introduced in the process of analyzing the memory performance of the application program, for example, the memory leakage problem of the application program is analyzed, the detection range is comprehensive, the detection efficiency is improved, and extra memory overflow is not generated.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 is a flow chart of a method for analyzing memory performance according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating an apparatus structure of an apparatus for analyzing memory performance according to an embodiment of the present invention;
fig. 3 shows a schematic diagram of an electronic device connection structure according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and "a plurality" typically includes at least two.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that, although the terms first, second, third, etc. may be used in the embodiments of the present invention to describe ..., these terms are not intended to be limiting for 8230; etc. These terms are used only to distinguish between 8230; and vice versa. For example, a first 8230; also referred to as a second 8230; without departing from the scope of embodiments of the invention, similarly, the second one (8230) \... also known as the first one (8230); 8230).
The words "if", as used herein may be interpreted as "at ...whenor" when ...when or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or apparatus. Without further limitation, an element defined by the phrases "comprising one of ..." does not exclude the presence of additional like elements in an article or device comprising the element.
An alternative embodiment of the present invention is described in detail below with reference to the drawings.
Example 1
As shown in fig. 1, according to a specific implementation manner of an embodiment of the present disclosure, in a first aspect, an embodiment of the present disclosure provides a method for analyzing memory performance, which specifically includes the following method steps:
s102: and starting and operating an analysis process for performing performance analysis on the memory performance in a plug-in mode according with a preset plug-in format at the computer end.
In this step, the preset plug-in format may be a gradle plug-in format, and the preset plug-in format may also be a jar plug-in format. The above is merely an example, and other preset plug-in formats may be adopted, which are not described herein again.
S104: and unloading the memory snapshot and pulling the memory snapshot to the computer terminal.
In this step, the operation of unloading the memory snapshot is uniformly completed in the operation, and the operation of unloading the memory snapshot can be performed through a command in a preset format no matter in the manual detection or the automatic test process. For example, the command in the preset format may be an adb command, and may also be a command in another preset format, which is not listed here.
In addition, the memory snapshot can be pulled to the computer side in various ways. For example, in a specific application scenario, after the memory snapshot is unloaded, the Hprof file is pulled to the computer side in an adb pull manner. The above is only one way, and other ways are also possible, and are not described herein again.
S106: and analyzing the memory snapshot at the computer terminal, and analyzing the storage information in the memory snapshot to obtain a corresponding analysis result.
Optionally, the step of performing S106 to analyze the storage information in the memory snapshot to obtain a corresponding analysis result includes the following steps:
analyzing the storage information in the memory snapshot to obtain corresponding analysis information;
searching any active object in the memory snapshot and any fragment object in the memory snapshot according to the analysis information;
searching first reference chain information corresponding to any one movable object according to the analysis information, and searching second reference chain information corresponding to any one fragment object according to the analysis information; obtaining a search result;
judging whether any movable object is held according to the search result, and judging whether any fragmented object is held according to the search result to obtain a holding result;
and judging whether any movable object and/or any fragmented object is to be recycled or not according to the holding result.
Optionally, determining whether any movable object is held according to the search result, and determining whether any fragmented object is held according to the search result, and obtaining the holding result includes the following steps:
if first reference chain information corresponding to any one of the activity objects is searched according to the analysis information, any one of the activity objects corresponding to the first reference chain information is a held object; and
and if the second reference chain information corresponding to any fragment object is searched according to the analysis result, any fragment object corresponding to the second reference chain information is the held object.
Optionally, the step of determining whether any movable object and/or any fragmented object is to be recycled according to the holding result includes the following steps:
if the holding result is: any activity object corresponding to the first reference chain information is a held object, and any activity object corresponding to the first reference chain information is an object which cannot be recycled; and
if the holding result is: if any fragment object corresponding to the second reference chain information is a held object, any fragment object corresponding to the second reference chain information is an object that cannot be recycled.
Optionally, determining whether any movable object is held according to the search result, and determining whether any fragmented object is held according to the search result, and obtaining the holding result further includes the following steps:
if the first reference chain information corresponding to any one of the activity objects is not searched according to the analysis information, any one of the activity objects corresponding to the first reference chain information is not a held object; and
and if the second reference chain information corresponding to any fragment object is not searched according to the analysis result, any fragment object corresponding to the second reference chain information is not the held object.
Optionally, the determining, according to the holding result, whether any one of the active objects and/or any one of the fragmented objects is to be recovered further includes the following steps:
if the holding result is: if any activity object corresponding to the first reference chain information is not a held object, any activity object corresponding to the first reference chain information can be a recycled object; and
if the holding result is: if none of the fragmented objects corresponding to the second reference chain information is a held object, any of the fragmented objects corresponding to the second reference chain information can be a recycled object.
S108: assembling according to the reference chain information corresponding to the active objects and/or the fragment objects in the analysis result to obtain corresponding hypertext markup language files; and the reference chain information comprises first reference chain information corresponding to any one active object and second reference chain information corresponding to any one fragment object.
Optionally, before assembling according to the reference chain information corresponding to the active object and/or the fragment object in the parsing result to obtain the corresponding hypertext markup language document, the method further includes the following steps:
reading first association information of any one activity object corresponding to the first reference chain information; reading second associated information of any fragment object corresponding to the second reference chain information;
wherein the first associated information at least comprises one item:
first object name information corresponding to any one of the activity objects corresponding to the first reference chain information, first object link information corresponding to any one of the activity objects corresponding to the first reference chain information, and first object size information corresponding to any one of the activity objects corresponding to the first reference chain information;
the second associated information includes at least one of:
and the second object name information corresponds to any fragment object corresponding to the second reference chain information, the second object link information corresponds to any fragment object corresponding to the second reference chain information, and the second object size information corresponds to any fragment object corresponding to the second reference chain information.
The method for analyzing the memory performance provided by the embodiment of the invention has the following advantages:
the method has the advantages that 1: without any code intrusion.
The method has the advantages that: the monitoring range is as follows: all leakage items, large objects and other memory problems.
The method has the advantages that: detection efficiency: the analysis process is on the computer side, so the analysis process is short in time consumption and efficient.
The advantages are that: because the analysis process is completed at the computer end, the operation of the application program at the mobile end cannot be influenced.
The advantages are that: the provided analysis process of the memory performance can be automatically tested.
By providing the method for analyzing the memory performance, the intrusion code does not need to be introduced in the process of analyzing the memory performance of the application program, for example, the problem of memory leakage of the application program is analyzed, so that the detection range is comprehensive, the detection efficiency is improved, and additional memory overflow is not generated.
Example 2
The embodiment of the present disclosure is applied to embodiment 1, and is used to implement the method steps as described in embodiment 1, and the explanation based on the same name and meaning is the same as that in embodiment 1, and has the same technical effect as that in embodiment 1, and details are not repeated here. Referring to fig. 2, according to a specific embodiment of the present disclosure, in a second aspect, an embodiment of the present disclosure provides an apparatus for analyzing memory performance, including a start analyzing unit 202, a processing unit 204, an analyzing unit 206, an assembling unit 208, and the like, which are as follows:
a starting analysis unit 202, configured to start and run an analysis process for analyzing the memory performance in a plug-in mode conforming to a preset plug-in format at the computer end;
the processing unit 204 is configured to unload the memory snapshot and pull the memory snapshot to the computer;
the analyzing unit 206 is configured to analyze the memory snapshot processed by the processing unit 204 at the computer side, and analyze storage information in the memory snapshot to obtain a corresponding analysis result;
the assembling unit 208 assembles the reference chain information corresponding to the active object and/or the fragment object in the analysis result analyzed by the analyzing unit 206 to obtain a corresponding hypertext markup language file; and the reference chain information comprises first reference chain information corresponding to any one movable object and second reference chain information corresponding to any one fragment object.
Optionally, the parsing unit 206 is specifically configured to:
analyzing the stored information in the memory snapshot to obtain corresponding analysis information;
searching any active object in the memory snapshot and any fragment object in the memory snapshot according to the analysis information;
searching first reference chain information corresponding to any one movable object according to the analysis information, and searching second reference chain information corresponding to any one fragment object according to the analysis information; obtaining a search result;
judging whether any movable object is held according to the search result, and judging whether any fragmented object is held according to the search result to obtain a holding result;
and judging whether any movable object and/or any fragmented object is to be recycled or not according to the holding result.
Optionally, the parsing unit 206 is further specifically configured to:
if first reference chain information corresponding to any one of the activity objects is searched according to the analysis information, any one of the activity objects corresponding to the first reference chain information is a held object; and
and if the second reference chain information corresponding to any fragment object is searched according to the analysis result, any fragment object corresponding to the second reference chain information is the held object.
Optionally, the parsing unit 206 is further specifically configured to:
if the holding result is: any activity object corresponding to the first reference chain information is a held object, and any activity object corresponding to the first reference chain information is an object which cannot be recycled; and
if the holding result is: if any fragment object corresponding to the second reference chain information is a held object, any fragment object corresponding to the second reference chain information is an object that cannot be recycled.
Optionally, the parsing unit 206 is further specifically configured to:
if the first reference chain information corresponding to any one of the activity objects is not searched according to the analysis information, any one of the activity objects corresponding to the first reference chain information is not a held object; and
and if the second reference chain information corresponding to any fragment object is not searched according to the analysis result, any fragment object corresponding to the second reference chain information is not the held object.
Optionally, the parsing unit 206 is further specifically configured to:
if the holding result is: if any activity object corresponding to the first reference chain information is not a held object, any activity object corresponding to the first reference chain information can be a recycled object; and
if the holding result is: if any one of the fragment objects corresponding to the second reference chain information is not a held object, any one of the fragment objects corresponding to the second reference chain information can be a recycled object.
Optionally, the apparatus further comprises:
a reading unit (not shown in fig. 2), configured to read first association information of any one of the active objects corresponding to the first reference chain information before the assembling unit 208 assembles the reference chain information corresponding to the active object and/or the fragment object in the parsing result to obtain a corresponding hypertext markup language file; reading second associated information of any fragment object corresponding to the second reference chain information;
the first associated information read by the reading unit at least comprises one item:
first object name information corresponding to any one of the activity objects corresponding to the first reference chain information, first object link information corresponding to any one of the activity objects corresponding to the first reference chain information, and first object size information corresponding to any one of the activity objects corresponding to the first reference chain information;
the second association information read by the reading unit at least comprises one item:
and the second object name information corresponds to any fragment object corresponding to the second reference chain information, the second object link information corresponds to any fragment object corresponding to the second reference chain information, and the second object size information corresponds to any fragment object corresponding to the second reference chain information.
By providing the memory performance analysis device, intrusion codes do not need to be introduced in the process of analyzing the memory performance of the application program, for example, the memory leakage problem of the application program is analyzed, so that the detection range is comprehensive, and the detection efficiency is improved.
Example 3
As shown in fig. 3, this embodiment provides an electronic device, where the electronic device is used to perform a method for analyzing memory performance, and the electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the one processor to cause the at least one processor to: the process of analyzing the memory performance of the application program does not need to introduce intrusion codes, for example, the problem of memory leakage of the application program is analyzed, the detection range is comprehensive, the detection efficiency is improved, and extra memory overflow is not generated.
Example 4
Embodiments of the present disclosure provide a non-volatile computer storage medium, where computer-executable instructions are stored, and the computer-executable instructions may execute the method for analyzing memory performance in any of the method embodiments.
Example 5
Referring now to FIG. 3, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 302 or a program loaded from a storage device 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be alternatively implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: the process of analyzing the memory performance of the application program does not need to introduce intrusion codes, for example, the problem of memory leakage of the application program is analyzed, the detection range is comprehensive, the detection efficiency is improved, and extra memory overflow is not generated.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: the process of analyzing the memory performance of the application program does not need to introduce intrusion codes, for example, the problem of memory leakage of the application program is analyzed, the detection range is comprehensive, the detection efficiency is improved, and extra memory overflow is not generated.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.

Claims (9)

1. A method for analyzing memory performance is characterized by comprising the following steps:
starting an analysis process for performing performance analysis on the memory performance in a plug-in mode conforming to a preset plug-in format at a computer end;
unloading the memory snapshot and pulling the memory snapshot to the computer end;
analyzing the memory snapshot at the computer terminal, and analyzing the storage information in the memory snapshot to obtain a corresponding analysis result;
assembling according to the reference chain information corresponding to the active object and the fragment object in the analysis result to obtain a corresponding hypertext markup language file; the reference chain information comprises first reference chain information corresponding to any one movable object and second reference chain information corresponding to any one fragment object;
analyzing the storage information in the memory snapshot to obtain a corresponding analysis result comprises:
analyzing the storage information in the memory snapshot to obtain corresponding analysis information;
searching any movable object in the memory snapshot and any fragment object in the memory snapshot according to the analysis information;
searching first reference chain information corresponding to any one movable object according to the analysis information, and searching second reference chain information corresponding to any one fragment object according to the analysis information; obtaining a search result;
judging whether any movable object is held according to the search result, and judging whether any fragmented object is held according to the search result to obtain a holding result;
and judging whether any movable object and/or any fragmented object is to be recycled or not according to the holding result.
2. The method of claim 1, wherein the determining whether any active object is held according to the search result and whether any fragmented object is held according to the search result, and obtaining the holding result comprises:
if the first reference chain information corresponding to any one activity object is searched according to the analysis information, any one activity object corresponding to the first reference chain information is a held object; and
and if the second reference chain information corresponding to any fragment object is searched according to the analysis result, any fragment object corresponding to the second reference chain information is a held object.
3. The method according to claim 2, wherein the determining whether any active object and/or any fragmented object is to be reclaimed according to the holding result comprises:
if the holding result is: if any activity object corresponding to the first reference chain information is a held object, any activity object corresponding to the first reference chain information is an object which cannot be recycled; and
if the holding result is: and if any fragment object corresponding to the second reference chain information is a held object, any fragment object corresponding to the second reference chain information is an object which cannot be recycled.
4. The method of claim 1, wherein determining whether any active object is held according to the search result and determining whether any fragmented object is held according to the search result, and obtaining holding results further comprises:
if the first reference chain information corresponding to any activity object is not searched according to the analysis information, any activity object corresponding to the first reference chain information is not a held object; and
if the second reference chain information corresponding to any fragment object is not searched according to the analysis result, any fragment object corresponding to the second reference chain information is not a held object.
5. The method according to claim 4, wherein said determining whether any active object and/or any fragmented object is to be reclaimed further comprises:
if the holding result is: if any active object corresponding to the first reference chain information is not a held object, any active object corresponding to the first reference chain information can be a recycled object; and
if the holding result is: if none of the fragment objects corresponding to the second reference chain information is a held object, any of the fragment objects corresponding to the second reference chain information can be a recycled object.
6. The method according to claim 1, wherein before the assembling according to the reference chain information corresponding to the active object and/or the fragment object in the parsing result to obtain the corresponding html document, the method further comprises:
reading first association information of any one activity object corresponding to the first reference chain information; reading second association information of any fragment object corresponding to the second reference chain information;
wherein the first associated information at least comprises one of:
first object name information corresponding to any one activity object corresponding to the first reference chain information, first object link information corresponding to any one activity object corresponding to the first reference chain information, and first object size information corresponding to any one activity object corresponding to the first reference chain information;
the second associated information includes at least one of:
second object name information corresponding to any fragment object corresponding to the second reference chain information, second object link information corresponding to any fragment object corresponding to the second reference chain information, and second object size information corresponding to any fragment object corresponding to the second reference chain information.
7. An apparatus for analyzing memory performance, comprising:
the starting analysis unit is used for starting an analysis process of analyzing the memory performance in a plug-in mode conforming to a preset plug-in format at the computer end;
the processing unit is used for unloading the memory snapshot and pulling the memory snapshot to the computer end;
the analysis unit is used for analyzing the memory snapshot processed by the processing unit at the computer terminal, analyzing the storage information in the memory snapshot and obtaining a corresponding analysis result;
the assembling unit is used for assembling according to the reference chain information corresponding to the movable object and the fragment object in the analysis result analyzed by the analyzing unit to obtain a corresponding hypertext markup language file; the reference chain information comprises first reference chain information corresponding to any one movable object and second reference chain information corresponding to any one fragment object;
the analysis unit is used for:
analyzing the storage information in the memory snapshot to obtain corresponding analysis information;
searching any movable object in the memory snapshot and any fragment object in the memory snapshot according to the analysis information;
searching first reference chain information corresponding to any one movable object according to the analysis information, and searching second reference chain information corresponding to any one fragment object according to the analysis information; obtaining a search result;
judging whether any movable object is held according to the search result, and judging whether any fragmented object is held according to the search result to obtain a holding result;
and judging whether any movable object and/or any fragmented object is to be recycled or not according to the holding result.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method of any one of claims 1 to 6.
CN202010032133.2A 2020-01-13 2020-01-13 Memory performance analysis method, device, medium and electronic equipment Active CN111274082B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010032133.2A CN111274082B (en) 2020-01-13 2020-01-13 Memory performance analysis method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010032133.2A CN111274082B (en) 2020-01-13 2020-01-13 Memory performance analysis method, device, medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111274082A CN111274082A (en) 2020-06-12
CN111274082B true CN111274082B (en) 2023-04-18

Family

ID=71001865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010032133.2A Active CN111274082B (en) 2020-01-13 2020-01-13 Memory performance analysis method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111274082B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1221912A (en) * 1997-12-09 1999-07-07 太阳微系统有限公司 Object heap analysis techniques for discovering memory leaks and other run-time information
CN107247658A (en) * 2017-05-25 2017-10-13 珠海金山网络游戏科技有限公司 It is a kind of that the method and device that mobile phone application memory is revealed is detected by memory image
CN107967205A (en) * 2016-10-18 2018-04-27 广州市动景计算机科技有限公司 A kind of memory analysis method, apparatus, system and computing device
CN109558308A (en) * 2018-09-29 2019-04-02 中国平安人寿保险股份有限公司 Application program method for detecting memory leakage, device, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7496615B2 (en) * 2004-03-11 2009-02-24 International Business Machines Corporation Method, system and article for detecting critical memory leaks causing out-of-memory errors in Java software
US8977600B2 (en) * 2013-05-24 2015-03-10 Software AG USA Inc. System and method for continuous analytics run against a combination of static and real-time data
US10860377B2 (en) * 2017-03-22 2020-12-08 Salesforce.Com, Inc. Technologies for identifying thread memory allocation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1221912A (en) * 1997-12-09 1999-07-07 太阳微系统有限公司 Object heap analysis techniques for discovering memory leaks and other run-time information
CN107967205A (en) * 2016-10-18 2018-04-27 广州市动景计算机科技有限公司 A kind of memory analysis method, apparatus, system and computing device
CN107247658A (en) * 2017-05-25 2017-10-13 珠海金山网络游戏科技有限公司 It is a kind of that the method and device that mobile phone application memory is revealed is detected by memory image
CN109558308A (en) * 2018-09-29 2019-04-02 中国平安人寿保险股份有限公司 Application program method for detecting memory leakage, device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
探讨JAVA的内存泄漏问题;陈华;《科技信息》(第33期);全文 *

Also Published As

Publication number Publication date
CN111274082A (en) 2020-06-12

Similar Documents

Publication Publication Date Title
CN110502357B (en) Stack backtracking method, device, medium and equipment
CN110865898B (en) Method, device, medium and equipment for converging crash call stack
CN110489179B (en) Method, device, medium and equipment for acquiring call stack frame function signature
CN110471709B (en) Method, device, medium and electronic equipment for accelerating webpage opening speed
CN110764941B (en) Method, device, medium and equipment for acquiring call stack frame instruction offset
CN110362488B (en) Page testing method and device, electronic equipment and storage medium
CN111367516B (en) Application interface generation method and device and electronic equipment
CN111813465B (en) Information acquisition method, device, medium and equipment
CN110750545A (en) Dynamic library hot update method, device, medium and equipment
CN110489165B (en) Method, device, medium and equipment for acquiring call stack frame instruction offset
CN115145605A (en) Vehicle-mounted application software upgrading method and system, electronic equipment and storage medium
CN111045926B (en) Application program jamming detection method, device, medium and electronic equipment
CN110941549B (en) Memory leak detection method, device, medium and electronic equipment
CN111274082B (en) Memory performance analysis method, device, medium and electronic equipment
CN111258797B (en) Memory leak detection method, device, medium and electronic equipment
CN111382017A (en) Fault query method, device, server and storage medium
CN110727480B (en) Method, device, medium and equipment for acquiring call stack frame instruction offset
CN110336688B (en) Alarm system detection method and device, computing equipment and storage medium
CN116185805A (en) Code detection method, device, equipment and storage medium
CN111813667A (en) Method, device, medium and equipment for collecting application running track
CN111381813A (en) Front-end page debugging method and device, computer equipment and storage medium
CN111258852B (en) Abnormal data monitoring method, device, electronic equipment and storage medium
CN111813641B (en) Method, device, medium and equipment for collecting crash information
CN111274057B (en) Memory leakage link processing method, device, medium and electronic equipment
CN111782410B (en) Lock jam monitoring method and device, electronic equipment and computer readable medium

Legal Events

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