Memory leak determination method and device, electronic equipment and storage medium
By generating differential analysis between current and historical monitoring snapshots, automatic memory leak detection solves the problems of high cost and low efficiency of manual analysis, and achieves efficient and accurate memory leak detection and timely reminders to ensure application stability.
Patent Information
- Application Number
- CN202410487590.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-22
- Publication Date
- 2025-10-28
AI Technical Summary
In the existing technology, memory leak detection relies on manual analysis, which is costly, inefficient and inaccurate, making it difficult to locate memory leak problems in a timely and effective manner.
By generating current and historical monitoring snapshots when memory leak conditions are detected, leak prompt events are generated based on difference analysis and displayed visually, automatic memory leak detection is achieved.
It reduces the cost of memory leak detection, improves detection efficiency and accuracy, and promptly reminds users of memory leaks to ensure the stability of applications.
Smart Images

Figure CN120849244A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for determining memory leaks. Background Technology
[0002] A memory leak occurs when unused memory is not properly released, resulting in memory space being occupied and unusable. As memory leaks continue, this unreleased memory accumulates, eventually leading to memory exhaustion, program crashes, or slow performance. Therefore, timely and effective detection of memory leaks is crucial.
[0003] Currently, memory leak detection typically involves two methods. One method uses memory leak detection tools to detect information related to memory usage, such as allocated memory addresses and sizes, and then manually analyzes this information to determine if a memory leak exists. The other method involves manually analyzing program code and reviewing logs to identify which objects have not been released and which code segments contain memory leaks.
[0004] However, whether using memory leak detection tools or manually analyzing code to check for memory leaks, both require manual analysis and location of the problem. This necessitates users possessing certain professional knowledge and skills, resulting in high labor costs. Furthermore, manual analysis is often prone to bias, potentially leading to false positives or false negatives in memory leak detection, thus causing low efficiency and accuracy in memory leak detection. Summary of the Invention
[0005] This disclosure provides a method, apparatus, electronic device, and storage medium for determining memory leaks, aiming to improve the efficiency and accuracy of memory leak detection while reducing the cost of memory leak detection.
[0006] In a first aspect, embodiments of this disclosure provide a method for determining memory leaks, the method comprising:
[0007] When a target condition in the set of criteria for determining a memory leak is detected, a current monitoring snapshot corresponding to the information to be monitored at the current moment is determined; wherein, the information to be monitored includes pre-subscribed monitoring event types; and,
[0008] Retrieve historical monitoring snapshots corresponding to the target conditions; wherein the historical monitoring snapshots correspond to the information to be monitored;
[0009] If a memory leak is determined to exist based on the current monitoring snapshot and the historical monitoring snapshot, a leak alert event is generated based on the target monitoring information of the leak.
[0010] Display the leak notification event on the target page.
[0011] Secondly, embodiments of this disclosure also provide a memory leak determination apparatus, the apparatus comprising:
[0012] The current monitoring snapshot determination module is used to determine the current monitoring snapshot corresponding to the information to be monitored at the current moment when a target condition in the set of memory leak determination conditions is detected; wherein, the information to be monitored includes pre-subscribed monitoring event types;
[0013] The historical monitoring snapshot determination module is used to retrieve historical monitoring snapshots corresponding to the target conditions; wherein, the historical monitoring snapshots correspond to the information to be monitored;
[0014] The leakage alert event determination module is used to generate a leakage alert event based on the target monitoring information of the leak when it is determined that there is a memory leak based on the current monitoring snapshot and the historical monitoring snapshot.
[0015] The display module is used to display the leak notification event on the target page.
[0016] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0017] One or more processors;
[0018] Storage device for storing one or more programs.
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the memory leak determination method as described in any embodiment of this disclosure.
[0020] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the memory leak determination method as described in any of the embodiments of this disclosure.
[0021] The technical solution of this disclosure, when a target condition in the set of memory leak determination conditions is detected, determines the current monitoring snapshot corresponding to the information to be monitored at the current moment, and retrieves the historical monitoring snapshot corresponding to the target condition. Then, based on the current and historical monitoring snapshots, if a memory leak is determined to exist, a leak alert event is generated based on the leak's target monitoring information and displayed on the target page. This solves the problems of high cost, low efficiency, and low accuracy associated with manual analysis of memory leaks in related technologies. It achieves automated memory leak detection when a target condition in the set of memory leak determination conditions is detected, determines the existence of a memory leak based on the current and historical monitoring snapshots under the target conditions, and generates a leak alert event based on the leak's target monitoring information when a memory leak is determined, providing a visual alert. This reduces the cost of memory leak detection while improving its efficiency and accuracy, enabling timely reminders of memory leaks, facilitating users to effectively locate the cause of memory leaks, and promptly resolve the problem, thereby ensuring application stability. Attached Figure Description
[0022] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0023] Figure 1 This is a schematic flowchart of a method for determining memory leaks provided in an embodiment of this disclosure;
[0024] Figure 2 This is a schematic diagram of a memory leak detection method based on an embodiment of the present disclosure;
[0025] Figure 3 This is a schematic diagram of a memory leak detection method based on an embodiment of the present disclosure;
[0026] Figure 4 This is a flowchart illustrating a method for determining a memory leak provided in an embodiment of this disclosure;
[0027] Figure 5 This is a schematic diagram of a disclosure notification event provided based on an embodiment of this disclosure;
[0028] Figure 6 This is a schematic diagram of a disclosure notification event provided based on an embodiment of this disclosure;
[0029] Figure 7This is a flowchart illustrating a method for determining a memory leak provided in an embodiment of this disclosure;
[0030] Figure 8 This is a schematic diagram of a pop-up window provided based on an embodiment of this disclosure;
[0031] Figure 9 This is a schematic diagram of a pop-up window provided based on an embodiment of this disclosure;
[0032] Figure 10 This is a schematic diagram of the target debugging tool provided based on the embodiments of this disclosure;
[0033] Figure 11 This is a schematic diagram of a memory leak determination device provided in an embodiment of this disclosure;
[0034] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0035] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0036] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0037] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0038] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0039] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0040] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0041] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0042] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0043] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0044] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0045] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0046] Before introducing this technical solution, an exemplary application scenario can be provided. The technical solution of this disclosure can be applied to any scenario requiring memory leak detection. For example, when developing an application project, digital content is typically created within the project. All program code and resource files related to content creation are stored in memory. If unused memory is not properly released, excessive memory usage will occur, causing the application to malfunction. To ensure the performance and stability of the application, it is necessary to detect memory leaks in the project. Memory leak detection can be implemented based on the technical solution of this disclosure.
[0047] Figure 1 This is a schematic flowchart of a method for determining memory leaks provided in an embodiment of this disclosure. This embodiment of the disclosure is applicable to situations where memory leaks are detected. The method can be executed by a memory leak determination device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, such as a mobile terminal, a PC, or a server.
[0048] like Figure 1 As shown, the method includes:
[0049] S110. When a target condition in the set of conditions for determining memory leaks is detected, determine the current monitoring snapshot corresponding to the information to be monitored at the current moment, and retrieve the historical monitoring snapshot corresponding to the target condition.
[0050] The memory leak detection condition set includes multiple memory leak detection conditions, which can be pre-set to determine whether to perform memory leak detection. For example, memory leak detection conditions could include triggering a memory leak detection button, application startup, startup of an application project within the application, application project execution, or application project shutdown. The monitored information includes pre-subscribed monitoring event types. Monitoring event types refer to the types of events that need to be monitored. For example, monitored events could be circular reference events, weak reference events, events where closures incorrectly use classes, element events, etc. Historical monitoring snapshots correspond to the monitored information; that is, historical monitoring snapshots are also snapshot records of the monitored information. Monitoring snapshots can include listening information for events of different monitoring event types, such as, but not limited to, event name, number of listeners, corresponding callback functions, and event priorities.
[0051] In this embodiment, when the system detects that any condition in the set of conditions for determining memory leaks is met, it considers that memory leak detection is required, and the met condition is taken as the target condition. Monitoring snapshots corresponding to the information to be monitored can be recorded in real time or periodically, and memory leak detection is performed based on the monitoring snapshot recorded at each time point. The method for performing memory leak detection on the monitoring snapshot at each time point is the same; any time point can be taken as the current moment. The following is an example of performing memory leak detection on the monitoring snapshot at the current moment. The current moment is the moment when memory leak detection is required, and the monitoring snapshot corresponding to the information to be monitored at the current moment is the current monitoring snapshot. When performing memory leak detection based on the current monitoring snapshot, historical monitoring snapshots recorded when the target condition is met can be obtained. The recording time of the historical monitoring snapshots is before the current moment. For example, the historical monitoring snapshot can be a monitoring snapshot recorded at the moment before the current moment, or a monitoring snapshot selected from multiple monitoring snapshots at moments before the current moment; or, the historical monitoring snapshot can also be a monitoring snapshot recorded before the project started, so as to determine whether there is a memory leak at the current moment by comparing the current monitoring snapshot and the historical monitoring snapshot.
[0052] It should be noted that the historical monitoring snapshots retrieved differ depending on the target conditions. Optionally, the set of conditions for determining memory leaks includes both project runtime conditions and project start / stop conditions. That is, the target conditions can be either project runtime conditions or project start / stop conditions. Based on this, there are at least two ways to retrieve historical monitoring snapshots corresponding to the target conditions:
[0053] One approach is to retrieve the monitoring snapshot generated at the previous moment when the target conditions are the engineering operation conditions, and use it as a historical monitoring snapshot.
[0054] Specifically, when the conditions for project operation are met, the current monitoring snapshot corresponding to the information to be monitored is determined at the current moment. The monitoring snapshot generated at the moment preceding the current moment is retrieved as a historical monitoring snapshot. Based on the monitoring snapshots recorded at two adjacent moments, the system detects whether memory leaks exist during project operation. This achieves automated memory leak detection during project operation while improving the accuracy of memory leak detection. After obtaining the current monitoring snapshot, it can be stored in a cache for future use as a historical monitoring snapshot for memory leak detection.
[0055] For example, see Figure 1After the application starts, a memory monitoring tool can be initialized to listen for project start events, serving as the trigger for monitoring. Upon detecting a project start event, after a configurable delay (set to a set duration), the application is considered running, confirming that the project's running conditions are met. If these conditions are met, the application periodically snapshots the events registered in its event management subsystem and records them in a cache, initiating a monitoring loop. Based on the configured loop interval, a snapshot is recorded at fixed intervals. For example, a snapshot is recorded at time n. After waiting for a preset time, the next monitoring trigger is considered, and a snapshot is recorded at time n+1. This snapshot at time n+1 becomes the current snapshot, while the snapshot at time n can be used as a historical snapshot.
[0056] Another approach is to retrieve the monitoring snapshot obtained when the target project starts, when the target conditions are the start-up and shutdown conditions, and use it as a historical monitoring snapshot.
[0057] Specifically, when the project startup condition is met, a monitoring snapshot corresponding to the information to be monitored is recorded in the cache. When the shutdown condition is met, the monitoring snapshot corresponding to the information to be monitored is recorded as the current monitoring snapshot. The monitoring snapshot obtained when the target project starts is retrieved from the cache as a historical monitoring snapshot, and memory leaks are detected based on the two monitoring snapshots before and after project startup. This allows memory leak detection to be performed after the project is shut down, preventing missed detections and improving the accuracy and reliability of memory leak detection.
[0058] For example, see Figure 2 After the application starts, the memory monitoring tool initializes and listens for project start and stop events as the starting points for monitoring. When a project start event is detected, the project start condition is considered met, and a monitoring snapshot (time n) is recorded. After the project starts normally, it is in a running state. When a project stop event is detected, after a set delay, the project stop condition is considered met, and the project stops, recording a monitoring snapshot (time n+1). The monitoring snapshot at time n+1 is the current monitoring snapshot, and the monitoring snapshot at time n serves as a historical monitoring snapshot for when the target project starts.
[0059] S120. If a memory leak is determined to exist based on the current monitoring snapshot and historical monitoring snapshots, a leak alert event is generated based on the target monitoring information of the leak.
[0060] In this embodiment, a difference calculation can be performed on the current monitoring snapshot and historical monitoring snapshots to calculate the snapshot difference, and the existence of a memory leak can be determined based on the snapshot difference. For example, by comparing the number of objects and reference relationships in the two snapshots, if the number of some objects increases abnormally, a memory leak is considered to exist; or, if the types of monitoring events in the two snapshots differ significantly, a memory leak is considered to exist. Alternatively, a similarity algorithm can be used to calculate the similarity between the current monitoring snapshot and historical monitoring snapshots, and if the similarity is less than a preset threshold, a memory leak is considered to exist. If a memory leak is determined to exist, the monitoring information corresponding to the memory leak can be used as the target monitoring information for the leak. Furthermore, the target monitoring information for the leak can be used as a leak notification event, or the target monitoring information for the leak can be filled into a notification template to generate a leak notification event.
[0061] S130. Display the leak notification event on the target page.
[0062] In this embodiment, the leakage alert event can be visualized on the target page. Users can learn about the potential memory leak by browsing the leakage alert event. Users can learn about the leakage event information from the displayed leakage alert event, which helps users to quickly locate and troubleshoot memory leaks.
[0063] The technical solution of this disclosure, when a target condition in the set of memory leak determination conditions is detected, determines the current monitoring snapshot corresponding to the information to be monitored at the current moment, and retrieves the historical monitoring snapshot corresponding to the target condition. Then, based on the current and historical monitoring snapshots, if a memory leak is determined to exist, a leak alert event is generated based on the leak's target monitoring information and displayed on the target page. This solves the problems of high cost, low efficiency, and low accuracy associated with manual analysis of memory leaks in related technologies. It achieves automated memory leak detection when a target condition in the set of memory leak determination conditions is detected, determines the existence of a memory leak based on the current and historical monitoring snapshots under the target conditions, and generates a leak alert event based on the leak's target monitoring information when a memory leak is determined, providing a visual alert. This reduces the cost of memory leak detection while improving its efficiency and accuracy, enabling timely reminders of memory leaks, facilitating users to effectively locate the cause of memory leaks, and promptly resolve the problem, thereby ensuring application stability.
[0064] Figure 4This is a flowchart illustrating a method for determining memory leaks provided in this embodiment. Based on the above embodiments, when determining whether a memory leak exists based on the current monitoring snapshot and historical monitoring snapshots, this embodiment can determine the difference increment information based on at least one event listener instance in the current monitoring snapshot and at least one event listener instance in the historical monitoring snapshot. Furthermore, when the difference increment information is greater than a preset threshold, a memory leak is determined to exist. For detailed implementation methods, please refer to the description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here.
[0065] like Figure 4 As shown, the method in this embodiment may specifically include:
[0066] S210. When a target condition in the set of conditions for determining memory leaks is detected, determine the current monitoring snapshot corresponding to the information to be monitored at the current moment, and retrieve the historical monitoring snapshot corresponding to the target condition.
[0067] S220. Based on at least one event listener instance in the current monitoring snapshot and at least one event listener instance in the historical monitoring snapshot, determine the differential incremental information.
[0068] In JavaScript, an event listener instance refers to an object or instance used to listen for a specific type of event. When the listened-for event is triggered, the event listener instance is executed. For example, in JavaScript, you can listen for events on DOM (Document Object Model) elements, such as button click events or input events in input boxes. In this case, the object being listened to is the DOM element. If you add a click listener to a DOM element, that click listener becomes an event listener instance, and when the user clicks the button, this event listener instance is executed.
[0069] In this embodiment, the difference between event listener instances in the current monitoring snapshot and at least one event listener instance in a historical monitoring snapshot can be compared to determine the difference increment information. For example, if the current monitoring snapshot includes event listener instances 1, 2, 3, and 4, and the historical monitoring snapshot includes event listener instances 1, 2, and 3, then the difference increment information can be event listener instance 4. Alternatively, the number of times the event listener instances are executed can be compared, and the difference between the execution counts can be calculated to obtain the difference increment information. For example, if event listener instance 1 is executed 15 times in the current monitoring snapshot and 5 times in the historical monitoring snapshot, then the difference of 10 can be used as the difference increment information.
[0070] For example, the current monitoring snapshot at time n+1 and the historical monitoring snapshot at time n are subjected to a difference calculation. The result of the difference calculation is used as the difference increment information, and the existence of memory leak is determined based on the difference increment information.
[0071] In this embodiment, based on at least one event listening instance in the current monitoring snapshot and at least one event listening instance in the historical monitoring snapshot, the difference increment information is determined, including: obtaining the aggregation number of the same event listening instance by aggregating at least one event listening instance in the current monitoring snapshot and the historical monitoring snapshot; determining the difference value of the aggregation number of the same event listening instance, and using the difference value as the difference increment information.
[0072] In practical applications, at least one event monitoring instance in the current monitoring snapshot and historical monitoring snapshots can be aggregated to obtain the aggregated number of the same event monitoring instance under each snapshot. Furthermore, the aggregated number of the same event monitoring instance under two snapshots can be interpolated to obtain the difference value of the same event monitoring instance, and the difference value can be used as the difference increment information.
[0073] For example, the event listener instances registered for each event type in the two snapshots are aggregated. The aggregation criterion can be a combination of the event listener instance name and the serialization characters of the execution method contained in the event listener instance to obtain the number of aggregated instances of the same event listener instance. Then, the difference in the number of aggregated instances of the same event listener instance in the two snapshots is compared to obtain the difference increment information.
[0074] S230. When the incremental difference information is greater than a preset threshold, a memory leak is determined to exist.
[0075] Specifically, the incremental difference information can be compared with a preset threshold. If the incremental difference information is greater than the preset threshold, a memory leak is identified. For example, if there are more than two incremental differences for the same event listener instance, a memory leak is considered to exist.
[0076] For example, see [link to example]. Figure 2 If the difference increment information is greater than a preset threshold, it is determined that a suspicious leak has been detected, that is, a memory leak has been confirmed; otherwise, step S210 is repeated to continue the memory leak detection.
[0077] It's important to note that memory leaks can occur not only when events are not properly released, but also when certain core objects are not properly released. These objects might be extended data classes or editor resource objects. Extended data classes define the data and behaviors specific to the engine and editor resource objects at the editor layer. When releasing the memory resources occupied by these objects, the extended data manager or editor resource manager calls the corresponding built-in functions of the extended data class or editor resource object to release the relevant references. If extended data classes or editor resource objects are created directly through their constructors in the code, and then not released using the built-in functions afterward, a memory leak will occur.
[0078] Therefore, in order to effectively detect potential memory leaks caused by objects, records can be made in the extension data set and editor resource set respectively during the initialization of each extension data class and / or editor resource object. When the callback function of the extension data class or editor resource object is called, the corresponding record is removed from the extension data set or editor resource set. So that when exiting the project, after the extension data manager or editor resource manager has released the extension data classes and editor resource objects it manages, the existence of memory leaks can be determined by checking whether the extension data set / editor resource set is empty.
[0079] In this embodiment, the target condition is the stop condition in the project start / stop conditions. The information to be monitored also includes pre-defined memory monitoring objects, which include extended data classes and / or editor resource objects. The method for determining memory leaks further includes: determining whether a memory monitoring object exists in the resource set; if a memory monitoring object exists, then a memory leak is determined to exist. The resource set can refer to a set used for recording during the initialization of the memory monitoring object and used for removal when the memory monitoring object calls its callback function.
[0080] In practical applications, when the stop-work condition is detected, it can be determined whether there is a memory monitoring object in the resource set. If a memory monitoring object exists, a memory leak is confirmed; if no memory monitoring object exists, it means that the memory monitoring object was released when exiting the project, and there is no memory leak. For example, when exiting the project, it is assumed that the stop-work condition is met, and it is checked whether the resource set recording the memory monitoring object is empty. If the resource set is not empty, it is assumed that a memory monitoring object exists, a memory leak is confirmed, and a pop-up warning is displayed when a memory leak is detected.
[0081] The technical solution provided in this embodiment not only enables memory leak detection for event listening instances, but also enables memory leak detection for memory monitoring objects, ensuring the comprehensiveness of memory leak detection and improving the accuracy and effectiveness of detection.
[0082] S240. If a memory leak is confirmed, a leak alert event is generated based on the target monitoring information of the leak.
[0083] In this embodiment, when a memory leak is determined to exist, the leak target monitoring information can be used to generate a leak alert event. This can be achieved by processing the target monitoring information based on the alert event display field corresponding to the target condition to obtain the leak alert event corresponding to the target monitoring information.
[0084] Among them, the prompt event display field can refer to the field that needs to be displayed.
[0085] Specifically, the display fields for alert events corresponding to the target conditions can be pre-configured. For example, these fields may include, but are not limited to, the project monitoring stage, the event management subsystem identifier, the event name, the incremental difference information of the event listener instances, and the aggregated number of event listener instances. The target monitoring information is then populated into the display fields corresponding to the target conditions to generate a leak alert event displaying the target monitoring information. This leak alert event not only contains the leaked target monitoring information but also corresponds to the target conditions, allowing users to clearly identify which leak events occurred and at which stage of the project the memory leak occurred, facilitating more efficient searching and location of the cause of the memory leak.
[0086] For example, leakage alert events can be displayed in two modes: one is a display mode corresponding to the project's operating conditions, used to alert users of leakage events during project operation. See also... Figure 5 Leakage alerts during project runtime can include the event management subsystem identifier, event name, incremental differences in event listener instances for different event types within a specified time period, and the aggregated number of event listener instances. Another display mode corresponds to project start / stop conditions and is used for leak event alerts upon project exit. See also... Figure 6 The leakage notification event when the project exits includes the event management subsystem identifier, event name, comparison with before the project started, the number of event listener instances that have not been canceled under different event types, and the aggregate number of event listener instances.
[0087] S250. Display the leak notification event on the target page.
[0088] The technical solution of this disclosure determines the difference increment information by comparing at least one event listening instance in the current monitoring snapshot with at least one event listening instance in the historical monitoring snapshot. Then, by comparing the difference increment information with a preset threshold, it determines whether there is a memory leak, thereby improving the accuracy of memory leak determination.
[0089] Figure 7 This is a flowchart illustrating a method for determining memory leaks provided in this embodiment. Based on the above embodiments, this embodiment further displays a pop-up window including a leak alert event on the target page. For detailed implementation methods, please refer to the description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here.
[0090] like Figure 7 As shown, the method in this embodiment may specifically include:
[0091] S310. When a target condition in the set of conditions for determining memory leaks is detected, determine the current monitoring snapshot corresponding to the information to be monitored at the current moment, and retrieve the historical monitoring snapshot corresponding to the target condition.
[0092] S320. If a memory leak is determined based on the current monitoring snapshot and historical monitoring snapshots, a leak alert event is generated based on the target monitoring information of the leak.
[0093] S330. Display a pop-up window on the target page that includes a leak alert event.
[0094] The pop-up window should include at least a control for printing associated information related to the leak notification event.
[0095] In this embodiment, a pop-up window including a leak alert event can be displayed on the target page. In this case, the pop-up window not only includes the leak alert event but also includes controls for printing associated information related to the leak alert event. For example, a schematic diagram of the pop-up window can be found... Figure 8 .
[0096] In this embodiment, the method for determining memory leaks further includes: in response to a triggering operation on the control, retrieving the program code associated with the leak notification event and displaying the program code in the target debugging tool; when a triggering operation on the program code is detected, navigating to the source code corresponding to the program code and displaying it.
[0097] The triggering actions include, but are not limited to, clicks, swipes, and touches. The target debugging tool can be an interactive interface for inputting and outputting text or commands. For example, the target debugging tool can be a browser's console.
[0098] In practical applications, when a user clicks on a control in a pop-up window, the system is considered to have detected a trigger operation on that control. At this point, the program code associated with the leak alert event is retrieved and output to the target debugging tool. This code is then displayed in the debugging tool, allowing the user to view the event monitoring instance for each detected anomaly. Users can also navigate to the corresponding source code by clicking on the program code, which is also displayed in the debugging tool. The technical solution provided in this embodiment, by systematically outputting the program code of the leak alert event to the target debugging tool, facilitates user debugging and location of leaky code using the output information, thereby improving the accuracy and efficiency of resolving memory leak problems.
[0099] For example, see Figure 8 Below the pop-up window on the right, a control 1 for printing information is displayed. Clicking this control will print the currently detected leak alert event to the target debugging tool, facilitating user investigation of the leak's source within the tool. A notification will pop up after the leak alert event is printed; see [link to documentation]. Figure 9 Users can quickly open the target debugging tool by clicking the button to open the target debugging tool, which displays the program code showing leak warning events. See also Figure 10 The target debugging tool displays the code segments corresponding to multiple leak alert events. If the printed information is incomplete, you can click control 1 again to get the complete information. The printed information shows each event management subsystem and the event monitoring instance that detected the leak, i.e., the leak alert event. You can navigate to the file and location of the method by clicking on the function in the program code, or directly clicking on the line number of a method, to display the source code. This facilitates subsequent investigation of the cause of memory leaks, determining the specific circumstances of the memory leak, formulating corresponding remediation strategies, optimizing code structure, and improving memory management mechanisms, thereby eliminating memory leak problems and improving system stability and performance.
[0100] It should be noted that the pop-up also includes controls to prevent the disclosure alert event from being displayed repeatedly. For example, see [link to example]. Figure 8 Control 2 is shown in the image. If the leak alert event displayed in the pop-up window is determined to be a false alarm or is unrelated to the current development content, the user can click on Control 2. After clicking, the same type of leak alert will be prevented from popping up until the entire application is closed.
[0101] The technical solution provided in this embodiment also supports the modification of configuration information. For example, the target conditions, the recording period of the monitoring snapshot, the preset threshold, the display field of the prompt event corresponding to the target conditions, etc. are modified. The modified values are saved in the cache and take effect when the configuration information is initialized, so as to realize the flexible configuration of information and improve the flexibility and versatility of memory leak detection.
[0102] The technical solution of this disclosure embodiment, by displaying a pop-up window including leakage warning events on the target page, enables users to know which memory leak events exist through the displayed leakage warning events. It also enables users to print the associated information related to the leakage warning events by triggering controls, thereby locating the memory leak events and analyzing the cause and specific circumstances of the leaks. This efficiently solves the memory leak problem and ensures the performance and stability of the application.
[0103] Figure 11 This is a schematic diagram of a memory leak determination device provided in an embodiment of this disclosure, as shown below. Figure 11 As shown, the device includes: a current monitoring snapshot determination module 410, a historical monitoring snapshot determination module 420, a leakage alert event determination module 430, and a display module 440.
[0104] The current monitoring snapshot determination module 410 is used to determine the current monitoring snapshot corresponding to the information to be monitored at the current moment when a target condition in the set of memory leak determination conditions is detected; wherein the information to be monitored includes pre-subscribed monitoring event types; the historical monitoring snapshot determination module 420 is used to retrieve the historical monitoring snapshot corresponding to the target condition; wherein the historical monitoring snapshot corresponds to the information to be monitored; the leak alert event determination module 430 is used to generate a leak alert event based on the target monitoring information of the leak when a memory leak is determined based on the current monitoring snapshot and the historical monitoring snapshot; and the display module 440 is used to display the leak alert event on the target page.
[0105] Based on the above technical solutions, the set of conditions for determining memory leaks includes engineering operation conditions and engineering start-up and shutdown conditions.
[0106] Based on the above technical solutions, the target condition is the engineering operation condition. The historical monitoring snapshot determination module 420 is used to retrieve the monitoring snapshot generated at the previous moment when the target condition is the engineering operation condition, and use it as the historical monitoring snapshot. The historical monitoring snapshot determination module 420 is also used to retrieve the monitoring snapshot obtained when the target project starts when the target condition is the engineering start-up / shutdown condition, and use it as the historical monitoring snapshot.
[0107] Based on the above technical solutions, the leakage alert event determination module 430 includes: a difference increment information determination unit and a memory leak detection unit. The difference increment information determination unit is used to determine difference increment information based on at least one event listening instance in the current monitoring snapshot and at least one event listening instance in the historical monitoring snapshot; the memory leak detection unit is used to determine that a memory leak exists when the difference increment information is greater than a preset threshold.
[0108] Based on the above technical solutions, the difference increment information determination unit includes an aggregation quantity determination unit and a difference increment information determination subunit. The aggregation quantity determination unit is used to obtain the aggregation quantity of the same event monitoring instance by aggregating at least one event monitoring instance in the current monitoring snapshot and the historical monitoring snapshot; the difference increment information determination subunit is used to determine the difference value of the aggregation quantity of the same event monitoring instance, and use the difference value as the difference increment information.
[0109] Based on the above technical solutions, the target condition is the stop working condition in the project start-stop conditions, and the information to be monitored also includes a pre-set memory monitoring object. The device further includes: a monitoring object determination unit, used to determine whether the memory monitoring object exists in the resource set, wherein the memory monitoring object includes extended data class and / or editor resource object; and a memory leak determination unit, used to determine that there is a memory leak if the memory monitoring object exists.
[0110] Based on the above technical solutions, the leakage alert event determination module 430 is used to process the target monitoring information based on the alert event display field corresponding to the target conditions to obtain the leakage alert event corresponding to the target monitoring information.
[0111] Based on the above technical solutions, the device further includes: a pop-up display module, used to display a pop-up window including a leakage warning event on the target page; wherein the pop-up window includes at least a control for printing associated information related to the leakage warning event.
[0112] Based on the above technical solutions, the device further includes: a program code display unit, configured to, in response to a trigger operation on the control, retrieve program code associated with the leakage warning event and display the program code in the target debugging tool; and a source code display unit, configured to, upon detecting a trigger operation on the program code, navigate to and display the source code corresponding to the program code.
[0113] The technical solution of this disclosure, when a target condition in the set of memory leak determination conditions is detected, determines the current monitoring snapshot corresponding to the information to be monitored at the current moment, and retrieves the historical monitoring snapshot corresponding to the target condition. Then, based on the current and historical monitoring snapshots, if a memory leak is determined to exist, a leak alert event is generated based on the leak's target monitoring information and displayed on the target page. This solves the problems of high cost, low efficiency, and low accuracy associated with manual analysis of memory leaks in related technologies. It achieves automated memory leak detection when a target condition in the set of memory leak determination conditions is detected, determines the existence of a memory leak based on the current and historical monitoring snapshots under the target conditions, and generates a leak alert event based on the leak's target monitoring information when a memory leak is determined, providing a visual alert. This reduces the cost of memory leak detection while improving its efficiency and accuracy, enabling timely reminders of memory leaks, facilitating users to effectively locate the cause of memory leaks, and promptly resolve the problem, thereby ensuring application stability.
[0114] The memory leak determination apparatus provided in this disclosure can execute the memory leak determination method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0115] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0116] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Reference is made below. Figure 12 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 12 The diagram below shows the structure of the terminal device or server 500. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 12 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0117] like Figure 12As shown, electronic device 500 may include a processing unit (e.g., central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. An edit / output (I / O) interface 505 is also connected to bus 504.
[0118] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 12 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0119] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0120] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0121] The electronic device provided in this embodiment and the memory leak determination method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0122] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the memory leak determination method provided in the above embodiments.
[0123] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0124] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0125] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0126] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: upon detecting that a target condition in the set of memory leak determination conditions is met, determine a current monitoring snapshot corresponding to the information to be monitored at the current moment; wherein the information to be monitored includes pre-subscribed monitoring event types; and retrieve a historical monitoring snapshot corresponding to the target condition; wherein the historical monitoring snapshot corresponds to the information to be monitored; if a memory leak is determined to exist based on the current monitoring snapshot and the historical monitoring snapshot, generate a leak alert event based on the leaked target monitoring information; and display the leak alert event on a target page.
[0127] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0129] According to one or more embodiments of this disclosure, [Example 1] provides a method for determining a memory leak, the method comprising:
[0130] When a target condition in the set of criteria for determining a memory leak is detected, a current monitoring snapshot corresponding to the information to be monitored at the current moment is determined; wherein, the information to be monitored includes pre-subscribed monitoring event types; and,
[0131] Retrieve historical monitoring snapshots corresponding to the target conditions; wherein the historical monitoring snapshots correspond to the information to be monitored;
[0132] If a memory leak is determined to exist based on the current monitoring snapshot and the historical monitoring snapshot, a leak alert event is generated based on the target monitoring information of the leak.
[0133] Display the leak notification event on the target page.
[0134] According to one or more embodiments of this disclosure, [Example 2] provides a method for determining memory leaks, further comprising:
[0135] The set of conditions for determining memory leaks includes project operation conditions and project start / stop conditions.
[0136] According to one or more embodiments of this disclosure, [Example 3] provides a method for determining memory leaks, further comprising:
[0137] When the target conditions are engineering operation conditions, retrieve the monitoring snapshot generated at the previous moment of the current moment as the historical monitoring snapshot;
[0138] When the target condition is the start-up and shutdown condition of the project, the monitoring snapshot obtained when the target project starts is retrieved and used as the historical monitoring snapshot.
[0139] According to one or more embodiments of this disclosure, [Example 4] provides a method for determining memory leaks, further comprising:
[0140] Based on at least one event listener instance in the current monitoring snapshot and at least one event listener instance in the historical monitoring snapshot, determine the differential incremental information;
[0141] When the incremental difference information is greater than a preset threshold, a memory leak is determined to exist.
[0142] According to one or more embodiments of this disclosure, [Example 5] provides a method for determining memory leaks, further comprising:
[0143] The number of aggregated instances of the same event is obtained by aggregating at least one event monitoring instance from the current monitoring snapshot and the historical monitoring snapshot.
[0144] Determine the difference in the number of aggregated instances of the same event listener, and use the difference value as the difference increment information.
[0145] According to one or more embodiments of this disclosure, [Example Six] provides a method for determining a memory leak, further comprising:
[0146] The target condition is the stop working condition in the project start-up and stop conditions, and the information to be monitored also includes a pre-set memory monitoring object;
[0147] Determine whether the memory monitoring object exists in the resource set, wherein the memory monitoring object includes extended data classes and / or editor resource objects;
[0148] If a memory monitoring object exists, then a memory leak is confirmed.
[0149] According to one or more embodiments of this disclosure, [Example Seven] provides a method for determining memory leaks, further comprising:
[0150] The target monitoring information is processed based on the prompt event display field corresponding to the target condition to obtain the leakage prompt event corresponding to the target monitoring information.
[0151] According to one or more embodiments of this disclosure, [Example Eight] provides a method for determining memory leaks, further comprising:
[0152] A pop-up window displaying a leak alert event will be displayed on the target page;
[0153] The pop-up window also includes at least a control for printing associated information related to the leak notification event.
[0154] According to one or more embodiments of this disclosure, [Example Nine] provides a method for determining memory leaks, further comprising:
[0155] In response to a triggering operation on the control, the program code associated with the leak alert event is retrieved and displayed in the target debugging tool;
[0156] When a trigger operation on the program code is detected, the system can navigate to and display the source code corresponding to the program code.
[0157] According to one or more embodiments of this disclosure, [Example 10] provides a memory leak determination apparatus, comprising:
[0158] The current monitoring snapshot determination module is used to determine the current monitoring snapshot corresponding to the information to be monitored at the current moment when a target condition in the set of memory leak determination conditions is detected; wherein, the information to be monitored includes pre-subscribed monitoring event types;
[0159] The historical monitoring snapshot determination module is used to retrieve historical monitoring snapshots corresponding to the target conditions; wherein, the historical monitoring snapshots correspond to the information to be monitored;
[0160] The leakage alert event determination module is used to generate a leakage alert event based on the target monitoring information of the leak when it is determined that there is a memory leak based on the current monitoring snapshot and the historical monitoring snapshot.
[0161] The display module is used to display the leak notification event on the target page.
[0162] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0163] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0164] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for determining memory leaks, characterized in that, include: When a target condition in the set of criteria for determining a memory leak is detected, a current monitoring snapshot corresponding to the information to be monitored at the current moment is determined; wherein, the information to be monitored includes pre-subscribed monitoring event types; and, Retrieve historical monitoring snapshots corresponding to the target conditions; wherein the historical monitoring snapshots correspond to the information to be monitored; If a memory leak is determined to exist based on the current monitoring snapshot and the historical monitoring snapshot, a leak alert event is generated based on the target monitoring information of the leak. Display the leak notification event on the target page.
2. The method according to claim 1, characterized in that, The set of conditions for determining memory leaks includes project operation conditions and project start / stop conditions.
3. The method according to claim 2, characterized in that, The target conditions are the engineering operating conditions, and retrieving the historical monitoring snapshots corresponding to the target conditions includes: When the target conditions are engineering operation conditions, retrieve the monitoring snapshot generated at the previous moment of the current moment as the historical monitoring snapshot; When the target condition is the start-up and shutdown condition of the project, the monitoring snapshot obtained when the target project starts is retrieved and used as the historical monitoring snapshot.
4. The method according to claim 1, characterized in that, Based on the current monitoring snapshot and the historical monitoring snapshot, determine whether a memory leak exists, including: Based on at least one event listener instance in the current monitoring snapshot and at least one event listener instance in the historical monitoring snapshot, determine the differential incremental information; When the incremental difference information is greater than a preset threshold, a memory leak is determined to exist.
5. The method according to claim 4, characterized in that, The step of determining incremental difference information based on at least one event listener instance in the current monitoring snapshot and at least one event listener instance in the historical monitoring snapshot includes: The number of aggregated instances of the same event is obtained by aggregating at least one event monitoring instance from the current monitoring snapshot and the historical monitoring snapshot. Determine the difference in the number of aggregated instances of the same event listener, and use the difference value as the difference increment information.
6. The method according to claim 4, characterized in that, The target condition is the stop condition in the project start / stop conditions, and the information to be monitored also includes a pre-defined memory monitoring object. The method further includes: Determine whether the memory monitoring object exists in the resource set, wherein the memory monitoring object includes extended data classes and / or editor resource objects; If a memory monitoring object exists, then a memory leak is confirmed.
7. The method according to claim 1, 4, or 6, characterized in that, If a memory leak is confirmed, the generation of a leak alert event based on the target monitoring information of the leak includes: The target monitoring information is processed based on the prompt event display field corresponding to the target condition to obtain the leakage prompt event corresponding to the target monitoring information.
8. The method according to claim 1, characterized in that, The method further includes: A pop-up window displaying a leak alert event will be displayed on the target page; The pop-up window also includes at least a control for printing associated information related to the leak notification event.
9. The method according to claim 8, characterized in that, The method further includes: In response to a triggering operation on the control, the program code associated with the leak alert event is retrieved and displayed in the target debugging tool; When a trigger operation on the program code is detected, the system can navigate to and display the source code corresponding to the program code.
10. A device for determining memory leaks, characterized in that, include: The current monitoring snapshot determination module is used to determine the current monitoring snapshot corresponding to the information to be monitored at the current moment when a target condition in the set of memory leak determination conditions is detected; wherein, the information to be monitored includes pre-subscribed monitoring event types; The historical monitoring snapshot determination module is used to retrieve historical monitoring snapshots corresponding to the target conditions; wherein, the historical monitoring snapshots correspond to the information to be monitored; The leakage alert event determination module is used to generate a leakage alert event based on the target monitoring information of the leak when it is determined that there is a memory leak based on the current monitoring snapshot and the historical monitoring snapshot. The display module is used to display the leak notification event on the target page.
11. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the memory leak determination method as described in any one of claims 1-9.
12. A storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to perform the method for determining a memory leak as described in any one of claims 1-9.