Method and device for obtaining memory occupation amount, computer equipment and medium
A technology of occupancy and memory, applied in the field of obtaining memory occupancy, can solve problems such as inability to optimize memory occupancy, inability to provide optimization directions for developers, and inability to guarantee program running efficiency.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0050] This embodiment provides a method for obtaining memory usage, such as figure 1 As shown, the methods include:
[0051] S110, acquiring all function information in the program module;
[0052] Here, the program modules may include multiple types, and methods for obtaining function information for each program module are different. The program modules in this embodiment include: a self-defined program module, a third-party program module, and a program module provided by the system (hereinafter referred to as the system program module).
[0053] As an optional embodiment, when the program module is a custom program module and the function is a function in the custom program module, obtaining all the function information in the program module may include:
[0054] Obtain the mapping file map corresponding to the custom program module, which is automatically generated when compiling the custom module;
[0055] Obtain the function information of the function according to ...
Embodiment 3
[0267] This embodiment provides a computer device, such as image 3 As shown, it includes a memory 310, a processor 320, and a computer program 311 stored on the memory 310 and operable on the processor 320. When the processor 320 executes the computer program 311, the following steps are implemented:
[0268] Obtain all function information in the program module;
[0269] Hook the starting point of each function by using the preset first hook function, and inject the preset first monitoring function into the starting point of each function;
[0270] using a preset second hook function to hook the end point of each function, and inject the preset second monitoring function into the end point of each function;
[0271] When using the first monitoring function to monitor the start time of each function execution, acquire the first memory usage corresponding to each function;
[0272] When the end moment of execution of each function is monitored by the second moni...
Embodiment 4
[0278] This embodiment provides a computer-readable storage medium 400, such as Figure 4 As shown, a computer program 411 is stored thereon, and when the computer program 411 is executed by a processor, the following steps are implemented:
[0279] Obtain all function information in the program module;
[0280] Hook the starting point of each function by using the preset first hook function, and inject the preset first monitoring function into the starting point of each function;
[0281] using a preset second hook function to hook the end point of each function, and inject the preset second monitoring function into the end point of each function;
[0282] When using the first monitoring function to monitor the start time of each function execution, acquire the first memory usage corresponding to each function;
[0283] When the end moment of execution of each function is monitored by the second monitoring function, the second memory usage corresponding to each...
PUM

Abstract
Description
Claims
Application Information

- Generate Ideas
- Intellectual Property
- Life Sciences
- Materials
- Tech Scout
- Unparalleled Data Quality
- Higher Quality Content
- 60% Fewer Hallucinations
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2025 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com