Information processing method, program product, and computing device for implementing memory analysis
Patent Information
- Application Number
- CN202310166947.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-13
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-02-13
AI Technical Summary
Existing technologies lack effective tools for memory analysis, making it difficult to efficiently pinpoint the factors causing abnormal increases in memory usage during application software operation.
By establishing a connection with the monitoring service module of the target operating system, the system obtains a set of memory allocation event information of the application software, aggregates event information with the same field value into a group, establishes a correlation, reduces redundant storage, and saves space.
It enables efficient identification of factors causing abnormal increases in memory usage, saves storage space, reduces tool interference with application software, and lowers development costs.
Smart Images

Figure CN116225931B_ABST
Abstract
Description
Technical Field
[0001] Several embodiments of this specification relate to the field of software testing technology, and in particular to an information processing method, program product, and computing device for implementing memory analysis. Background Technology
[0002] During application software development, several tests need to be performed. One of these tests is to check whether the application software exhibits abnormally high memory usage while running on the operating system.
[0003] To complete the above tests, memory analysis is needed to examine the process of the application software running on the operating system. However, currently, there is a lack of tools that can effectively facilitate memory analysis. Summary of the Invention
[0004] According to a first aspect of several embodiments of this specification, an information processing method for implementing memory analysis is proposed, the method comprising:
[0005] Establish a connection for invoking a monitoring service module in the target operating system; wherein the application software runs on the target operating system, and the monitoring service module is at least used to: monitor memory allocation events in the target operating system;
[0006] The monitoring service module is invoked through the connection to obtain a set of memory allocation event information associated with the application software. Each memory allocation event information includes at least two fields and their values.
[0007] For the memory allocation event information set, memory allocation event information that includes a specified field with the same field value is grouped together, and an association relationship is established between this group of memory allocation event information and the same field value of the specified field.
[0008] According to a second aspect of several embodiments of this specification, a program product is provided that executes the method described in the first aspect at runtime.
[0009] According to a third aspect of several embodiments of this specification, a computing device is provided, including a memory and a processor; the memory is used to store computer instructions executable on the processor, and the processor is used to implement the method of the first aspect when executing the computer instructions.
[0010] According to a fourth aspect of several embodiments of this specification, a computer-readable storage medium is provided that stores a computer program, which, when executed by a processor, implements the method described in the first aspect.
[0011] The technical solution disclosed herein provides a tool (a software product) for memory analysis. This tool establishes a connection to a monitoring service module in the target operating system (on which the application software to be analyzed runs). The monitoring service module monitors memory allocation events in the target operating system. In this way, the tool can obtain a set of memory allocation event information associated with the application software. Each memory allocation event includes at least two fields and their values. The memory allocation event information associated with the application software can be used to perform memory analysis on the process of the application software running on a specific operating system.
[0012] It should be noted that one or more specified fields in the memory allocation event information may be related to factors that cause an abnormal increase in memory usage. In order to easily find the factors that cause an abnormal increase in memory usage, it is necessary to be able to efficiently locate all memory allocation event information including the value of a certain field of the specified field.
[0013] Therefore, the set of memory allocation event information associated with the application software can be further processed. Using a single specified field as the aggregation dimension, memory allocation event information with the same field value under the specified field can be aggregated into a group, and this group of memory allocation event information can be associated with the same field value under the specified field.
[0014] In this way, on the one hand, it is possible to efficiently locate all memory allocation event information, including the value of a specified field, based on the association between the value of a specified field and a set of memory allocation event information.
[0015] On the other hand, compared to the approach of "establishing the association between the field value of the specified field in each memory allocation event and the memory allocation event for each memory allocation event", the approach of "aggregating memory allocation event information with the same field value in the specified field into a group and establishing the association between this group of memory allocation event information and the field value of a single specified field" can avoid repeatedly storing the same field value of the specified field, thus saving storage space. Attached Figure Description
[0016] Figure 1 An exemplary flowchart is provided for an information processing method for implementing memory analysis.
[0017] Figure 2 A schematic diagram illustrating the communication process between an exemplary provider product and a target operating system.
[0018] Figure 3 This is a schematic diagram of the structure of a computing device provided in this disclosure.
[0019] In the accompanying drawings, identical or corresponding reference numerals denote identical or corresponding parts. Any number of elements in the drawings is for illustrative purposes only and not for limitation, and any naming is for distinction only and has no limiting meaning. Detailed Implementation
[0020] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0021] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0022] The user information (including but not limited to user device information, user personal information, user location information, user travel information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0023] The application software disclosed herein needs to be installed and run on a specific operating system. For example, the application software may need to be installed and run on Apple's iOS mobile operating system, or it may need to be installed and run on Google's Android mobile operating system.
[0024] It's easy to understand that during the process of an application running on the operating system (which can be understood as a process), it requests memory space from the operating system. From the operating system's perspective, it needs to allocate memory space to the threads created by the application for their use. After the thread terminates, the operating system will reclaim (also known as release) the memory space occupied by that thread.
[0025] Typically, during the operation of application software on an operating system, the amount of memory space occupied by the application software needs to meet certain expectations. If it does not meet these expectations, it means that memory usage has increased abnormally. For example, the operating system may set an upper limit on the amount of memory space that the application software can occupy based on its type. If the actual amount of memory space occupied by the application software exceeds this limit, it means that memory usage has increased abnormally, and the operating system may forcibly terminate the application software. Alternatively, the application software developers may have certain design requirements for the amount of memory usage during the application software's operation on the operating system. For example, the amount of memory space occupied by a thread created by a certain application software module during execution cannot exceed a certain threshold. If this threshold is exceeded, it means that memory usage has increased abnormally, and the application software quality has not met the design requirements.
[0026] Therefore, before releasing a version of an application, developers often need to test its memory usage performance. Specific testing methods include installing the application on the operating system, running one or more functional instances (creating threads), analyzing the memory usage during these instances (i.e., memory analysis), and identifying and fixing any abnormal increases in memory usage (i.e., bug fixing).
[0027] To perform memory analysis on application software running on the operating system, a method is first needed to obtain memory allocation event information generated during the application's operation. Furthermore, it must be considered that current application software often has a large codebase and involves multiple technology stacks. This means that the code segments involved in a single functional instance of the application are widely distributed, and the code logic of a single functional instance is also quite complex (involving complex stacks, i.e., long chains of code segments that need to be called). This implies that the application involves frequent thread creation during the execution of a functional instance, resulting in a relatively chaotic array of memory allocation events. If an abnormal increase in memory usage is detected, it is not easy to pinpoint the cause (i.e., the code segment) based on the memory allocation event information generated during the execution of that functional instance.
[0028] Therefore, the technical solution provided in this disclosure offers a tool for memory analysis. This tool does not need to be embedded in the application software to be analyzed, but rather exists as a program product independent of the application software. If the tool is embedded in the application software, it will also run and request memory allocation during the application's operation. In this case, if an abnormal increase in memory usage occurs, it is difficult to distinguish whether the cause is the application software or the tool. Therefore, by making the tool a program product independent of the application software, on the one hand, it avoids intruding into the application software's internal structure, reducing the cost of developing the tool; on the other hand, it does not interfere with the memory analysis of the application software.
[0029] This tool establishes a connection to the monitoring service module in the target operating system (on which the application software to be analyzed runs). The monitoring service module monitors memory allocation events in the target operating system. This allows the tool to obtain a set of memory allocation event information associated with the application software. Each memory allocation event includes at least two fields and their values. This memory allocation event information associated with the application software can then be used to perform memory analysis on the application software's operation on a specific operating system.
[0030] It should be noted that one or more specified fields in the memory allocation event information may be related to the factors (code snippets) that cause an abnormal increase in memory usage. In order to find the factors that cause an abnormal increase in memory usage, it is necessary to be able to efficiently locate all memory allocation event information that includes the value of a certain field of the specified field.
[0031] Therefore, the set of memory allocation event information associated with the application software can be further processed. Using a single specified field as the aggregation dimension, memory allocation event information with the same field value under the specified field can be aggregated into a group, and this group of memory allocation event information can be associated with the same field value under the specified field.
[0032] In this way, on the one hand, it is possible to efficiently locate all memory allocation event information, including the value of a specified field, based on the association between the value of a specified field and a set of memory allocation event information.
[0033] On the other hand, compared to the approach of "establishing the association between the field value of the specified field in each memory allocation event and the memory allocation event for each memory allocation event", the approach of "aggregating memory allocation event information with the same field value in the specified field into a group and establishing the association between this group of memory allocation event information and the field value of a single specified field" can avoid repeatedly storing the same field value of the specified field, thus saving storage space.
[0034] The technical solutions provided in this disclosure are described in detail below with reference to the accompanying drawings.
[0035] Figure 1 An exemplary flowchart is provided for an information processing method for implementing memory analysis, including the following steps:
[0036] S100: Establish a connection for calling the monitoring service module in the target operating system.
[0037] S102: Call the monitoring service module through the connection to obtain a set of memory allocation event information associated with the application software.
[0038] S104: For the memory allocation event information set, group the memory allocation event information that includes a specified field with the same field value into a group, and establish the association between this group of memory allocation event information and the same field value of the specified field.
[0039] Figure 1 The method flow shown can be applied to the program product provided in this disclosure, which serves as a tool for memory analysis.
[0040] The program product can be a command-line program or a program with a graphical user interface. In the embodiment where the program product is a command-line program, a script can be pre-edited, and the instructions in the script can be used to drive the command-line program to execute automatically. Figure 1 The steps shown demonstrate that, in the process of acquiring and processing memory allocation event information generated by the application software, no manual intervention is required (no manual input of commands into the command-line program is required to drive the command-line program to execute the steps).
[0041] The program product can run on the same operating system as the application software to be analyzed, or it can run on a different operating system.
[0042] The operating system described in this disclosure can be any existing operating system, such as Apple's iOS mobile operating system, Google's Android mobile operating system, or Apple's publicly released macOS computer operating system.
[0043] The target operating system is the operating system on which the application being analyzed runs, such as iOS. Most operating systems today have a monitoring service module for monitoring memory allocation events within the operating system. For example, iOS has an Instrument Server service module with multiple service capabilities, one of which is monitoring memory allocation events occurring within iOS.
[0044] The application product can establish a connection for invoking the monitoring service module in the target operating system. In an embodiment where the target service system is iOS and the monitoring service module is the Instrument Server service module, the application product can establish a connection with the LockDown service module in iOS to invoke the Instrument Server service module through the LockDown service module.
[0045] It should be noted that the application can be installed on iOS or macOS. When installed on macOS, the application allows the corresponding iOS mobile device to establish a connection (USB or Wi-Fi) with the corresponding macOS computer. Then, the application can call the MobileDevice service module in macOS, which in turn establishes a connection between the application and the Lockdown service module in iOS through the connection between the mobile device and the computer. It should also be noted that the application can call the usbmuxd service module in iOS to establish a connection with the Lockdown service module.
[0046] The application product connects with the monitoring service module and invokes the monitoring service module to obtain a collection of memory allocation event information for the application software in the target operating system. Each memory allocation event includes at least two fields and their values. Memory allocation event information may include at least the following fields: memory allocation time (event start time), memory reclamation time (event end time), allocated memory space size, allocated memory space address, the stack (backtrace) to which the memory allocation occurred, and memory allocation event type. The stack field value includes a sequence of storage addresses corresponding to at least two code segments of the application software. The stack can be understood as the execution sequence of code segments, where each node in the call sequence represents a code segment. Memory allocation event types may include heap memory allocation, virtual memory allocation, etc.
[0047] In an embodiment where the target operating system is iOS, the objectalloc interface of the Instrument Server service module can be called to obtain a set of memory allocation event information associated with the application software.
[0048] In addition to monitoring memory allocation events in the target operating system, the monitoring service module can also monitor memory usage within the target operating system. Thus, the application product can obtain not only a set of memory allocation event information associated with the application software from the monitoring service module, but also a summary of memory usage information associated with the application software. This summary of memory usage information can be understood as including at least the total memory size used by the application software during runtime.
[0049] Memory summary information can indicate the amount of memory used by an application at different times. This helps to determine whether there is an abnormal increase in memory usage during a specific period. Furthermore, the factors causing the abnormal increase in memory usage can be located based on the memory allocation event information during that specific period.
[0050] In embodiments where the target operating system is iOS, the application product can also call the sysmontap interface of the Instrument Server service module to obtain summary information on memory usage associated with the application software.
[0051] As an illustration, in an embodiment where the target operating system is iOS, the message structure used for communication between the program product and the Instrument Server service module may include a Message Header field, a Message PayloadHeader field, a Message Payload Auxiliary field, and a Message Payload Object field, where the Message Header field represents the message header, the Message Payload Header field represents the message payload header, the Message Payload Auxiliary field represents the auxiliary content of the message payload, and the Message Payload Object field represents the main content of the message payload.
[0052] After establishing a connection to invoke the Instrument Server service module, the application product will first receive a notification message from the Instrument Server service module. This notification message contains the names of the service interfaces provided by the Instrument Server service module and the version number of each service interface. For example, the notification message sent by the Instrument Server service module may include:
[0053] [com.apple.instruments.server.services.device.applicationListing=1,
[0054] com.apple.instruments.server.services.deviceinfo=111,
[0055] com.apple.instruments.server.services.objectalloc=5,
[0056] com.apple.instruments.server.services.sysmontap=3,
[0057] com.apple.instruments.server.services.vmtracking=1]
[0058] For example, in the case of “com.apple.instruments.server.services.device.applictionListing=1”, the left side of the equals sign is the name of a service interface that the Instrument Server service module can provide, and the right side of the equals sign is the version number of that service interface.
[0059] The objectalloc interface of the Instrument Server service module mentioned earlier can specifically refer to "com.apple.instruments.server.services.objectalloc=5". The sysmontap interface of the Instrument Server service module mentioned earlier can specifically refer to "com.apple.instruments.server.services.sysmontap=3".
[0060] Figure 2 A schematic diagram illustrating the communication process between an exemplary provider product and a target operating system. (Example:) Figure 2 As shown, the program product is, for example, a command-line tool installed on macOS, and the target operating system is, for example, iOS, where an application software that needs to perform memory analysis runs. The macOS computer and the iOS mobile device are connected at the hardware level via USB. Figure 2 (The hardware-level USB connection is not shown.) The script automatically drives the command-line tool, which establishes a connection with the Lockdown service module in iOS by calling the MobileDevice service module in macOS. Figure 2(The connection shown by the dashed line) then obtains the memory allocation event information associated with the application software from the Instrument Server service module in iOS through the LockDown service module.
[0061] The specified fields in this disclosure can be specified according to actual needs, and they generally refer to fields related to factors that cause abnormal increases in memory usage.
[0062] In some embodiments, the stack trace field or the memory allocation event type field in the memory allocation event information can be used as a specified field. It is easy to understand that abnormal increases in memory usage are often caused by a bug in a code segment in the stack trace, or by a problem with the memory allocation method (corresponding to the memory allocation event type).
[0063] For example, memory allocation events containing the same stack trace can be grouped together, establishing a correlation between this group of memory allocation events and the shared stack trace. This allows for efficient location of memory allocation events associated with a specific stack trace, and based on the located memory allocation events, analysis can be performed to determine if any bugs exist within the code of that stack trace.
[0064] For example, memory allocation event information containing the same memory allocation event type can be grouped together, and a correlation can be established between this group of memory allocation event information and the same memory allocation event type. In this way, memory allocation event information associated with a certain memory allocation method can be located relatively efficiently, and based on the located memory allocation event information, it can be analyzed and determined whether the application software is suitable for that memory allocation method.
[0065] Alternatively, a code snippet from the same stack trace can be used as a representative snippet to establish an association between this representative snippet and the set of memory allocation event information. Or, an association can be established between the application software module containing this representative code snippet and the set of memory allocation event information. This allows for relatively efficient location of the memory allocation event information associated with a specific representative snippet to determine if that snippet is the cause of the abnormal increase in memory usage. It also allows for relatively efficient location of the memory allocation event information associated with a specific application software module to determine if one or more code snippets within that module are the cause of the abnormal increase in memory usage.
[0066] In some embodiments, the storage address corresponding to each code segment in the stack field value can be replaced with a unique symbol. This can save storage space and facilitate the quick location of the memory allocation event information associated with a representative code segment in the stack information based on the unique symbol.
[0067] In addition, the program product can export the acquired memory allocation event information, memory summary information, etc., which makes it convenient for application software developers to perform memory analysis based on the exported information.
[0068] In addition, the application product may support at least one of the following features:
[0069] Compare the memory allocation event information generated by running multiple functional instances of the application software;
[0070] Compare the memory allocation event information generated during the operation of different versions of the application software;
[0071] The memory allocation event information associated with the application software is compared with the memory allocation event information associated with other application software running on the target operating system.
[0072] The above functions all help to perform memory analysis during the operation of application software.
[0073] In some embodiments, the application product may store the acquired information (memory allocation event information, memory summary information) locally. In other embodiments, the application product may also upload the acquired memory allocation event information to the cloud for storage.
[0074] This disclosure also provides a virtual apparatus for memory analysis, comprising:
[0075] A connection module establishes a connection for calling a monitoring service module in the target operating system; wherein the application software to be analyzed runs on the target operating system, and the monitoring service module is at least used to: monitor memory allocation events in the target operating system;
[0076] The acquisition module calls the monitoring service module through the connection to obtain a set of memory allocation event information associated with the application software. Each memory allocation event information includes at least two fields and their field values.
[0077] The processing module, for the set of memory allocation event information, groups memory allocation event information with the same field value in a specified field together, and establishes an association between this group of memory allocation event information and the same field value in the specified field.
[0078] This disclosure also provides a program product that executes the methods of embodiments of this disclosure during runtime.
[0079] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods of embodiments of this disclosure.
[0080] This disclosure also provides a computing device, including a memory and a processor; the memory is used to store computer instructions that can be executed on the processor, and the processor is used to implement the methods of the embodiments of this disclosure when executing the computer instructions.
[0081] Figure 3 This is a schematic diagram of the structure of a computing device provided in this disclosure. The computing device 15 may include, but is not limited to, a processor 151, a memory 152, and a bus 153 connecting different system components (including the memory 152 and the processor 151).
[0082] The memory 152 stores computer instructions that can be executed by the processor 151, enabling the processor 151 to perform the methods of any embodiment of this disclosure. The memory 152 may include a random access memory (RAM) 1521, a cache memory 1522, and / or a read-only memory (ROM) 1523. The memory 152 may also include a program tool 1525 having a set of program modules 1524, including but not limited to: an operating system, one or more application programs, other program modules, and program data. One or more combinations of these program modules may include an implementation of a network environment.
[0083] Bus 153 may include, for example, a data bus, an address bus, and a control bus. The computing device 15 can also communicate with external devices 155 via I / O interface 154, such as a keyboard or a Bluetooth device. The computing device 150 can also communicate with one or more networks via network adapter 156, such as a local area network (LAN), a wide area network (WAN), or a public network. As shown, network adapter 156 can also communicate with other modules of the computing device 15 via bus 153.
[0084] Furthermore, although the operations of the methods disclosed herein are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0085] While the spirit and principles of this disclosure have been described with reference to several specific embodiments, it should be understood that this disclosure is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for convenience of expression. This disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
[0086] The methods described in the above embodiments can be implemented by a computer chip or physical entity, or by a product with a certain function. A typical implementing device is a computer. Specifically, the computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0087] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this specification, the functions of each module can be implemented in one or more software and / or hardware.
[0088] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0089] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0090] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0091] The terminology used in the various embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the various embodiments of this specification. The singular forms “a,” “described,” and “the” as used in the various embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0092] It should be understood that although the terms first, second, third, etc., may be used to describe various information in various embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of various embodiments of this specification, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0093] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the method embodiments are basically similar to the method embodiments and are therefore described simply; relevant parts can be referred to the descriptions of the method embodiments. The method embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. When implementing the embodiments of this specification, the functions of each module can be implemented in one or more software and / or hardware. Alternatively, some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0094] The above description is merely a preferred embodiment of the various embodiments of this specification and is not intended to limit the various embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the various embodiments of this specification should be included within the protection scope of the various embodiments of this specification.
Claims
1. An information processing method for implementing memory analysis, the method being applied to a tool for memory analysis, the method comprising: Establish a connection with the LockDown service module in iOS, so as to call the Instrument Server service module through the LockDown service module; wherein, the application software runs on the iOS, and the Instrument Server service module is used to: monitor memory allocation events in the iOS; The objectalloc interface of the Instrument Server service module is invoked through the connection to obtain a set of memory allocation event information associated with the application software. Each memory allocation event information includes at least two fields and their values. For the memory allocation event information set, memory allocation event information that includes a specified field with the same field value is grouped together, and an association relationship is established between this group of memory allocation event information and the same field value of the specified field. The specified field is related to the factors that cause abnormal increase in memory usage. The specified field includes: a stack backtrace field, or a memory allocation event type field. If the specified field includes a stack backtrace field, establish the association between this set of memory allocation event information and the same field value of the specified field, including: Establish the association between this set of memory allocation event information and the application software module that matches the specified field with the same field value.
2. The method as described in claim 1, wherein, The Instrument Server service module is also used to monitor memory usage in the iOS. After calling the objectalloc interface of the Instrument Server service module through the connection, the method further includes: Obtain summary information on memory usage associated with the application software.
3. The method as described in claim 1, wherein, The Instrument Server service module is also used to monitor memory usage in the iOS. After calling the objectalloc interface of the Instrument Server service module through the connection, the method further includes: Call the sysmontap interface of the Instrument Server service module to obtain the memory usage summary information associated with the application software.
4. The method as described in claim 1, wherein, The method is applied to program products running on macOS; Establish a connection with the LockDown service module in iOS, including: Call the MobileDevice service module in macOS to establish a connection with the LockDown service module in iOS.
5. The method as described in claim 1, wherein, The stack backtrace field value includes a sequence of memory addresses corresponding to at least two code segments of the application software; If the specified field includes a stack backtrace field, the method further includes: Replace the storage address corresponding to each code snippet in the stack backtrace field value with a unique symbol.
6. The method of claim 1 or 2, further comprising: Export the information obtained by calling the Instrument Server service module and associated with the application software.
7. The method of claim 1, further comprising: Perform a comparison operation on the following information: The memory allocation event information generated by the application software running multiple functional instances respectively; Alternatively, information on memory allocation events generated during the operation of different versions of the application software; Alternatively, the memory allocation event information associated with the application software may be associated with memory allocation event information associated with other applications running on the iOS.
8. A program product that, when executed, performs the method of any one of claims 1-7.
9. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of any one of claims 1-7.
10. A computing device, comprising a memory and a processor; the memory being configured to store computer instructions executable on the processor, the processor being configured to implement the method of any one of claims 1-7 when executing the computer instructions.
Citation Information
Patent Citations
Jamming log information collection method and device, equipment and storage medium
CN112860469A
