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.

Pending Publication Date: 2019-10-18
武汉斗鱼鱼乐网络科技有限公司
View PDF4 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Aiming at the problems existing in the prior art, the embodiment of the present invention provides a method, device, computer equipment and medium for obtaining the memory usage, which is used to solve the problems in the prior art when the memory usage is relatively large during program development. Unable to provide developers with optimization directions, resulting in developers not being able to optimize memory usage in a targeted manner, resulting in a technical problem that the operating efficiency of the program cannot be guaranteed

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for obtaining memory occupation amount, computer equipment and medium
  • Method and device for obtaining memory occupation amount, computer equipment and medium
  • Method and device for obtaining memory occupation amount, computer equipment and medium

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The embodiment of the invention provides a method for obtaining the memory occupation amount. The method comprises the steps: obtaining all function information in a program module; utilizing a firsthook function to hook the starting point of each function, and injecting a first monitoring function into the starting point of each function; utilizing a second hook function to hook the end point ofeach function, and injecting a second monitoring function into the end point of each function; when the first monitoring function is used for monitoring the starting moment of execution of each function, obtaining a first memory occupation amount corresponding to each function; when a second monitoring function is used for monitoring the end moment of execution of each function, obtaining a second memory occupation amount corresponding to each function; according to the corresponding first memory occupancy amount and the corresponding second memory occupancy amount, determining the memory occupancy amount used by each function in the execution process; thus, which function uses a large amount of memory can be known, the function is optimized in a targeted manner, and the running efficiency of the program is ensured.

Description

technical field [0001] The invention belongs to the technical field of software development, and in particular relates to a method, device, computer equipment and medium for acquiring memory usage. Background technique [0002] In program development, the use of memory is a very critical indicator for program operation. During program operation, if the memory usage is too large, it will affect the operating efficiency of the entire program. [0003] In the prior art, the usage of the current memory is continuously obtained by setting a timer, so as to monitor the usage of the memory. However, this method can only monitor the usage of the memory, and cannot provide developers with an optimization direction, resulting in developers being unable to Targeted optimization of memory usage cannot improve the efficiency of program operation. Contents of the invention [0004] Aiming at the problems existing in the prior art, the embodiment of the present invention provides a meth...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/41G06F9/50G06F11/36
CPCG06F8/4434G06F9/5016G06F11/3644
Inventor 周志刚
Owner 武汉斗鱼鱼乐网络科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products