CN113326120A - Apparatus and method for managing memory - Google Patents

Apparatus and method for managing memory Download PDF

Info

Publication number
CN113326120A
CN113326120A CN202010132614.0A CN202010132614A CN113326120A CN 113326120 A CN113326120 A CN 113326120A CN 202010132614 A CN202010132614 A CN 202010132614A CN 113326120 A CN113326120 A CN 113326120A
Authority
CN
China
Prior art keywords
memory
information
network
message
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010132614.0A
Other languages
Chinese (zh)
Other versions
CN113326120B (en
Inventor
林嘉琳
汪庆权
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202010132614.0A priority Critical patent/CN113326120B/en
Publication of CN113326120A publication Critical patent/CN113326120A/en
Application granted granted Critical
Publication of CN113326120B publication Critical patent/CN113326120B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/328Computer systems status display
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a device and a method for managing a memory. The device comprises: the acquisition module is configured to acquire the size information of the allocated memory and the address information of the allocated memory when the memory is allocated to the network message extracted for network audit, acquire the time information during allocation as at least one of application time information, module type information of the network message and call stack information of the network message, and send the information to the processing module; and the processing module is constructed to apply for the memory and store the memory application information for statistics.

Description

Apparatus and method for managing memory
Technical Field
The invention relates to a device and a method for managing a memory
Background
With the rapid development of the internet, the application of the network auditing system is more and more extensive, and the accessed data needs to be extracted from massive network messages according to configuration rules. In network examination, frequently calling functions of memory allocation (user states are usually malloc, free, linux kernel states kmmalloc/vmaloc, kfree/vfree) and the like to apply for and release the memory is often required, and the requirement on memory resources is high. And the network audit equipment needs to apply for and release the memory frequently, so that a user cannot intuitively perceive the use condition of the memory. In the process of using the memory, when the memory is in a valley value, when the memory reaches a peak value, the memory occupied by which module is the most at present and the like, a user can not know the memory, the user can only roughly check the rough use condition of the current memory through a command line of Linux, and in actual operation, the user generally pays attention to the use condition of the memory until the problems of insufficient memory and the like occur.
Disclosure of Invention
An exemplary embodiment of the present invention is directed to overcoming the above-mentioned and/or other problems in the prior art. Accordingly, exemplary embodiments of the present invention provide an apparatus and method for managing memory.
According to an exemplary embodiment, an apparatus for managing memory includes: the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is constructed for acquiring the size information of a distributed memory and the address information of the distributed memory when the network message extracted for network audit is distributed with the memory, acquiring the time information during distribution as at least one of application time information, module type information of the network message and call stack information of the network message, and sending the acquired application time information, at least one of the module type information of the network message and the call stack information of the network message, the distributed memory size information as the size information of the applied memory, and the distributed memory address information as the address information of the applied memory and message type mark information indicating the applied memory to the processing module; and the processing module is configured to determine application memory use range information and apply for a memory according to the applied memory size information and the applied memory address information, and store the information sent to the processing module and the determined application memory use range information when the received acquisition module allocates a memory for a network message extracted for network audit, so as to serve as the memory application information corresponding to the network message.
The acquisition module is configured to encapsulate at least one of the acquired application time information, the module type information of the network packet, and the call stack information of the network packet, and the allocated memory size information as the applied memory size information, the allocated memory address information as the applied memory address information, and the message type flag information indicating the applied memory as a first UDP socket, and send the first UDP socket to the processing module.
The processing module is configured to determine, when receiving the first UDP socket, a type of the received message as an application memory according to message type flag information indicating the application memory in the first UDP socket.
The processing module is configured to store the memory application information in a log.
The processing module is configured to generate a visualization chart as a statistical result from the stored memory application information, the apparatus further comprising: a display module configured to display the visualization chart as the statistical result.
The acquisition module is configured to determine memory address information to be released when network auditing of the network message is finished, acquire time information during the determination as at least one of release time information, module type information of the network message after the network auditing is finished and call stack information of the network message after the network auditing is finished, and send the acquired release time information, at least one of the module type information of the network message after the network auditing is finished and the call stack information of the network message after the network auditing is finished, and the determined memory address information to be released as release memory address information and message type mark information indicating that the memory is to be released to the processing module;
the processing module is configured to acquire applied memory size information and applied time information corresponding to a network message of which network audit is finished and release a memory, and store the information sent to the processing module by the received acquisition module when the network audit of the network message is finished as memory release information corresponding to the network message.
The acquisition module is configured to encapsulate at least one of the acquired release time information, the module type information of the network packet after network audit is finished, and the call stack information of the network packet after network audit is finished, and the determined memory address information to be released as the release memory address information and the message type flag information indicating that the memory is to be released, as a second UDP socket, and send the second UDP socket to the processing module.
The processing module is configured to determine, when the second UDP socket is received, the type of the received message as a released memory according to message type flag information in the second UDP socket indicating that the memory is released.
The processing module is configured to store the memory release information in a log.
The processing module is configured to generate a visualization chart as a statistical result from the stored memory release information, the apparatus further comprising: a display module configured to display the visualization chart as the statistical result.
According to another exemplary embodiment, a method of managing memory includes: when a network message extracted for network audit is allocated with a memory, acquiring size information of the allocated memory and address information of the allocated memory, acquiring time information during allocation as at least one of application time information, module type information of the network message and call stack information of the network message, and sending at least one of the acquired application time information, the module type information of the network message and the call stack information of the network message, and the size information of the allocated memory as size information of the applied memory and the address information of the allocated memory as address information of the applied memory and message type mark information for indicating the applied memory; determining application memory use range information and applying for a memory according to the transmitted application memory size information and application memory address information, and storing the transmitted information and the determined application memory use range information when the memory is allocated to the network message extracted for network audit as the memory application information corresponding to the network message. The method further comprises the following steps: and storing the memory application information in a log.
The step of sending includes: and packaging at least one of the acquired application time information, the module type information of the network message and the call stack information of the network message, and the distributed memory size information as the applied memory size information, the distributed memory address information as the applied memory address information and the message type mark information indicating the applied memory as a first UDP socket, and sending the first UDP socket. The step of applying for the memory comprises: and when the first UDP socket is received, determining the type of the received information as the application memory according to the message type mark information indicating the application memory in the first UDP socket.
The method further comprises the following steps: generating a visual chart according to the stored memory application information to be used as a statistical result; and displaying a visual chart as a statistical result.
The method further comprises the following steps: determining memory address information to be released when network auditing of a network message is finished, acquiring time information during determination as at least one of release time information, module type information of the network message after the network auditing is finished and call stack information of the network message after the network auditing is finished, and sending at least one of the acquired release time information, the module type information of the network message after the network auditing is finished and the call stack information of the network message after the network auditing is finished, and the determined memory address information to be released as release memory address information and message type mark information indicating that a memory is to be released; acquiring the applied memory size information and the applied time information corresponding to the network message after the network audit is finished, releasing the memory, and storing and sending the information sent to the processing module by the acquisition module when the network audit is finished on the network message to be used as the memory release information corresponding to the network message. The method further comprises the following steps: and storing the memory release information in a log.
The step of sending at least one of the obtained release time information, the module type information of the network message after the network audit is finished, the call stack information of the network message after the network audit is finished, and the determined memory address information to be released as the release memory address information and the message type mark information indicating the memory to be released comprises the following steps: and packaging at least one of the acquired release time information, the module type information of the network message after the network audit is finished and the call stack information of the network message after the network audit is finished, and the determined memory address information to be released as the release memory address information and the message type mark information indicating the memory to be released into a second UDP socket, and sending the second UDP socket. The step of releasing the memory comprises the following steps: and when the second UDP socket is received, determining the type of the received information as the released memory according to the message type mark information which indicates the released memory in the second UDP socket.
The method further comprises the following steps: generating a visual chart according to the stored memory release information to serve as a statistical result; and displaying a visual chart as a statistical result.
According to other exemplary embodiments, an electronic device includes: at least one processor; a memory coupled to the at least one processor, the memory storing instructions that, when executed by the at least one processor, cause the electronic device to perform the method as described above.
According to other example embodiments, a non-transitory machine-readable medium may store computer-executable instructions that, when executed, cause at least one processor to perform a method as described above.
According to other exemplary embodiments, a computer program product comprises computer executable instructions which, when executed, cause at least one processor to perform the method as described above.
According to the device and the method for managing the memory, visual management of the memory can be realized in the network auditing process, multi-dimensional statistics can be carried out on each module of the network auditing, and the inquiry of the history record of the distribution/release of a certain address in the network auditing process can be supported. Therefore, a user can observe, monitor and trend the memory usage during the network auditing process.
Other features and aspects will become apparent from the following detailed description, the accompanying drawings, and the claims.
Drawings
The invention may be better understood by describing exemplary embodiments thereof in conjunction with the following drawings, in which:
FIG. 1 is a schematic block diagram illustrating an apparatus to manage memory in accordance with an illustrative embodiment;
FIG. 2 is a schematic flow chart diagram illustrating a method of managing memory in accordance with an illustrative embodiment;
fig. 3 is a schematic block diagram illustrating an electronic device according to an example embodiment.
Detailed Description
While specific embodiments of the invention will be described below, it should be noted that in the course of the detailed description of these embodiments, in order to provide a concise and concise description, all features of an actual implementation may not be described in detail. It should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions are made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Unless otherwise defined, technical or scientific terms used in the claims and the specification should have the ordinary meaning as understood by those of ordinary skill in the art to which the invention belongs. The use of "first," "second," and similar terms in the description and claims of the present application do not denote any order, quantity, or importance, but rather the terms are used to distinguish one element from another. The terms "a" or "an," and the like, do not denote a limitation of quantity, but rather denote the presence of at least one. The word "comprise" or "comprises", and the like, means that the element or item listed before "comprises" or "comprising" covers the element or item listed after "comprising" or "comprises" and its equivalent, and does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, nor are they restricted to direct or indirect connections.
Fig. 1 is a schematic block diagram illustrating an apparatus for managing memory according to an exemplary embodiment. The apparatus shown in fig. 1 may be implemented by a dedicated computing apparatus that manages the memory of a computing apparatus running, for example, a Linux system, separate from the memory-managed computing apparatus, or a general-purpose computing apparatus that executes a corresponding memory management method, or may be implemented by software executed by the memory-managed computing apparatus. The apparatus and/or method for managing memory according to the exemplary embodiment may manage memory in various situations, and in the following description, the apparatus and method for managing memory according to the exemplary embodiment will be specifically described by taking memory management during network auditing of a computing apparatus running a Linux system as an example. In the present application, network auditing refers to extracting and recording user access data and internet access behaviors from a network message according to a certain auditing strategy, such as http auditing, https auditing, mail auditing, dns auditing and the like. Memory is one of the components of a computing device, and is the bridge between external memory and the CPU. All programs in the computer are executed in the memory, so the performance of the memory has a great influence on the computer. A Memory (Memory) is also called an internal Memory and a main Memory, and functions to temporarily store operation data in a CPU and data exchanged with an external Memory such as a hard disk. As long as the computer is in operation, the CPU transfers data to be operated to the memory for operation, and after the operation is finished, the CPU transmits the result, and the operation of the memory also determines the stable operation of the computer.
In fig. 1, an apparatus for managing memory according to an exemplary embodiment may include an acquisition module 100 and a processing module 300.
The collection module 100 may collect information related to memory management when performing memory management. Specifically, when the computing device running the Linux system performs a network audit function on Email, for example, the computing device extracts a network packet related to Email from the network packet and applies for a corresponding memory. The acquisition module 100 may, for example, call a function such as userdef _ kmalloc to allocate a memory space with a size of, for example, 800 Byte. If successful, the address of the memory space may be determined, e.g., 0 xfffffffa 1000000.
Then, the acquisition module may acquire or obtain the allocated memory size information or the applied memory size information (800Byte) and the allocated memory address information or the applied memory address information (0 xfffffffffa 1000000). In addition, the acquisition module 100 may also acquire: current (i.e., at the time of distribution or at the time of application), i.e., application time information, e.g., 1 month, 1 day, wednesday, 22:59:59, 2020; a module ID, for example, 0x05, of Email corresponding to a network packet extracted by the current network audit; calling stack information corresponding to the network message extracted by the current network audit, for example, a function A- > a function B- > a function C; the message type flag information indicating that the operation is "memory application", for example, a message type flag bit "flag ═ 1".
Acquisition module 100 may then send the acquired information to processing module 300. In one example, the transmission may be by way of a UDP socket. For example, acquisition module 100 may encapsulate one or more of the acquired information into a first UDP Socket (UDP Socket), and may then send the encapsulated first UDP Socket to processing module 300.
The processing module 300 may also be referred to as a visualization management platform. When the processing module 300 receives information from the acquisition module 100, for example, the first UDP socket, the processing module 300 may first determine that it is an operation applying for memory through the message type flag "flag is 1". Then, the processing module 300 may process the received information, for example, other information except for the message type flag "flag 1".
Specifically, the processing module 300 may, for example, call a memory application function to apply for a memory according to the applied memory size information and the applied memory address information, and may determine the application memory usage range information, for example, "0 xfffffffffffa 1000000-0 xfffffffffffffa 1000400". The information can be convenient for the follow-up user to inquire the information of the release operation applied by the follow-up user according to the address. The processing module 300 may then store, e.g., record in a log, the determined application memory usage range information, the module ID "0 x 05", and other received information. Thus, the processing module 300 may perform statistics based on information stored or recorded in the log.
According to an exemplary embodiment, when counting the memory application information, the processing module 300 may generate various visual charts according to the stored memory application information as a statistical result: the total memory ranking condition applied by each module at present (namely, the ranking histogram of the memory size occupied by each module at this time), the total memory trend graph applied by each module at the same time period (a line graph showing the memory application use condition of each module), the frequency ranking condition of the memory applied by each module (a pie graph), the memory application condition of each call stack (a bar graph, for example, three-layer call can be shown by the bar graph, or the number of layers can be adjusted by the user to trace back), and other conditions including the historical record query of the memory application at a certain address. The processing module 300 may then store the statistics to a database.
As shown in fig. 1, the apparatus for managing memory according to an exemplary embodiment may further include a display device 500, for example, a display. When the processing module 300 generates the visualization chart as the statistical result, the display device 500 may display the visualization chart according to the user's needs or automatically, for example.
In addition, when the network audit is over and the memory needs to be released, the collection module 100 may collect or obtain information related to managing the memory. For example, the acquisition module 100 may call a userdef _ kfree (corresponding to userdef _ kmalloc) function to release the memory. Here, the acquisition module 100 may determine that the memory address information 0 xfffffffa 1000000 is to be released. Further, the acquisition module 100 may acquire: current time (time when determination of memory address information is performed or release time, for example, wednesday 23:59:59 on 1 month 1 in 2020); module type Information (ID) of a network packet for ending network audit, for example, 0x05 corresponding to Email audit; call stack information, e.g., function a- > function B- > function C; the message type flag information indicating that the operation is "release memory", for example, a message type flag bit "flag ═ 1".
Acquisition module 100 may then send the acquired information to processing module 300. In one example, the transmission may be by way of a UDP socket. For example, acquisition module 100 may encapsulate one or more of the acquired information into a second UDP Socket (UDP Socket), and may then send the encapsulated second UDP Socket to processing module 300.
When the processing module 300 receives information from the acquisition module 100, for example, the second UDP socket, the processing module 300 may first determine that it is an operation of releasing the memory through the message type flag "flag is 0". Then, the processing module 300 may process the received information, for example, other information except for the message type flag "flag ═ 0".
Specifically, the processing module 300 may, for example, call a memory release function to obtain (e.g., obtain from a log) memory size information and application time information of an application corresponding to a network packet after network audit is completed, and perform a memory release operation. The processing module 300 may then store the obtained information and other information received from the acquisition module 100 as memory release information, for example, in a log. Therefore, the processing module 300 can perform statistics according to the memory release information stored or recorded in the log.
According to an exemplary embodiment, when counting memory application information, the processing module 300 may generate various visual charts according to the stored memory release information as a statistical result: the ranking condition of the total memory released by each module currently (namely the ranking of the memory released by each module at the moment, a histogram), the trend chart of the total memory released by each module at the same time period (showing the memory release condition of each module, a line chart), the ranking condition of the times of releasing the memory by each module (a curve chart), the time occupation condition of each module, and other conditions including inquiry of historical records of memory release at a certain address. The processing module 300 may then store the statistics to a database.
Further, when the processing module 300 generates the visual chart as the statistical result, the display device 500 may display the visual chart according to the user's needs or automatically, for example. And because the distributed memory address can be obtained in the data acquisition module, the user is allowed to inquire the release record of the historical application through the memory address.
Therefore, according to the exemplary embodiment, through the visual management platform, in the network auditing process, a user can more intuitively know the use condition of the memory in the network auditing process through charts such as a pie chart and a bar chart, observe the fluctuation condition of the memory use during the network auditing process, further estimate the memory use trend, and query the historical use record according to the address, so that the user can better observe and monitor the system memory use state conveniently, and can predict the memory use trend through data analysis.
FIG. 2 is a schematic flow chart diagram illustrating a method of managing memory in accordance with an illustrative embodiment. The method according to the exemplary embodiments may be performed by the apparatus described above with reference to fig. 1, or by a general-purpose computing apparatus (e.g., a server, a personal computer, etc.) or a special-purpose computing apparatus (e.g., a programmable logic controller, etc.). In particular, the method of managing memory according to the exemplary embodiment may be applied to memory management when performing a web audit of a computing device running a Linux system.
As shown in fig. 2, first, in operation S201, when allocating a memory for a network packet extracted for network audit, allocated memory size information and allocated memory address information may be obtained. In addition, the time information during the distribution can be acquired as at least one of application time information, module type information of the network packet, and call stack information of the network packet. Then, at least one of the acquired application time information, the module type information of the network packet, and the call stack information of the network packet, and the allocated memory size information may be sent as the applied memory size information, and the allocated memory address information may be sent as the applied memory address information and the message type flag information indicating the applied memory. For example, the information (i.e., at least one of the acquired application time information, the module type information of the network packet, and the call stack information of the network packet, and the allocated memory size information as the applied memory size information, the allocated memory address information as the applied memory address information, and the message type flag information indicating the applied memory) may be encapsulated as a first UDP socket, and then the first UDP socket may be transmitted.
Then, in operation S203, the application memory usage range information and the application memory may be determined according to the transmitted application memory size information and the application memory address information, and the information transmitted when the memory is allocated to the network packet extracted for network audit and the determined application memory usage range information are stored as the memory application information corresponding to the network packet. For example, it may be recorded in a log.
Specifically, when applying for the memory, when receiving the first UDP socket, the device may determine, according to the message type flag information indicating that the memory is applied in the first UDP socket, that the type of the received message is the memory application. Then, the operations of applying for the memory and gathering out the memory application information can be performed.
In addition, the memory application information may be counted, and for example, various visualization charts (such as those described above with reference to fig. 1) may be generated and stored. Then, in operation S205, a visualization chart as a statistical result may be displayed.
When the network audit of the network packet is finished, in operation S207, the memory address information to be released may be determined, and the time information at the time of the determination is obtained as at least one of release time information, module type information of the network packet after the network audit is finished, and call stack information of the network packet after the network audit is finished. Then, at least one of the obtained release time information, the module type information of the network message after the network audit is finished, and the call stack information of the network message after the network audit is finished, and the determined memory address information to be released can be sent as the release memory address information and the message type flag information indicating that the memory is to be released. For example, the step of sending at least one of the obtained release time information, the module type information of the network packet after network audit and the call stack information of the network packet after network audit, and the determined memory address information to be released as the release memory address information and the message type flag information indicating that the memory is to be released may include encapsulating the obtained release time information, at least one of the module type information of the network packet after network audit and the call stack information of the network packet after network audit, and the determined memory address information to be released as the release memory address information and the message type flag information indicating that the memory is to be released as the second UDP socket, and sending the second UDP socket.
In operation S209, the memory size information and the application time information of the application corresponding to the network packet after the network audit is completed may be obtained and the memory is released, and the information sent to the processing module by the collecting module for storing and sending is used as the memory release information corresponding to the network packet after the network audit performed on the network packet is completed. For example, the memory release information may be recorded in a log.
Specifically, when the memory is released, it may be determined that the type of the received information is the released memory according to the message type flag information indicating to release the memory in the second UDP socket when the second UDP socket is received. Then, operations of releasing the memory, storing the memory release information, and the like may be performed.
Furthermore, a visual chart (such as the visual chart described above with reference to fig. 1) may also be generated as a statistical result from the stored memory release information, and the statistical result may be stored. Then, in operation S211, a visualization chart as a statistical result may be displayed.
According to the method for managing the memory, visual management of the memory can be realized in the network auditing process, multi-dimensional statistics can be carried out on each module of the network auditing, and the method can support the inquiry of the history record of the distribution/release of a certain address in the network auditing process. Therefore, a user can observe, monitor and trend the memory usage during the network auditing process.
Apparatus and methods according to example embodiments are described above with reference to fig. 1-2. However, the exemplary embodiments are not limited thereto, and for example, such a method may be implemented by hardware, software, or a combination of hardware and software. Fig. 3 is a schematic block diagram illustrating an electronic device according to an example embodiment. In this exemplary embodiment, the electronic device may include at least one processor 10 and a memory 30. The processor 10 may execute at least one computer readable instruction, i.e., an element described above as being implemented in software, stored or encoded in a memory 30, e.g., a non-volatile computer readable storage medium.
In another exemplary embodiment, computer-executable instructions are stored in the memory 30 which, when executed, cause the at least one processor 10 to implement or perform the method described above with reference to fig. 2.
It should be appreciated that the non-volatile computer or machine executable instructions stored in the memory 30, when executed, may cause the at least one processor 10 to perform the various operations and functions described in connection with fig. 2 in the various exemplary embodiments.
According to one exemplary embodiment, a program product, such as a non-volatile machine or computer readable medium, is provided. A non-transitory machine or computer readable medium may store instructions, such as the elements described above implemented in software, that when executed by a machine, such as a computer, cause the machine or computer to perform the various operations and functions described above in connection with fig. 2 in the various embodiments.
Some exemplary embodiments have been described above. Nevertheless, it will be understood that various modifications may be made. For example, suitable results may be achieved if the described techniques are performed in a different order and/or if components in the described systems, architectures, devices, or circuits are combined in a different manner and/or replaced or supplemented by additional components or their equivalents. Accordingly, other embodiments are within the scope of the following claims.

Claims (23)

1. An apparatus for managing memory, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is constructed for acquiring the size information of a distributed memory and the address information of the distributed memory when the network message extracted for network audit is distributed with the memory, acquiring the time information during distribution as at least one of application time information, module type information of the network message and call stack information of the network message, and sending the acquired application time information, at least one of the module type information of the network message and the call stack information of the network message, the distributed memory size information as the size information of the applied memory, and the distributed memory address information as the address information of the applied memory and message type mark information indicating the applied memory to the processing module;
and the processing module is configured to determine application memory use range information and apply for a memory according to the applied memory size information and the applied memory address information, and store the information sent to the processing module and the determined application memory use range information when the received acquisition module allocates a memory for a network message extracted for network audit, so as to serve as the memory application information corresponding to the network message.
2. The apparatus for managing memory according to claim 1, wherein the collecting module is configured to encapsulate at least one of the acquired application time information, the module type information of the network packet, and the call stack information of the network packet, and the allocated memory size information as the application memory size information, the allocated memory address information as the application memory address information, and the message type flag information indicating the application memory as the first UDP socket, and send the first UDP socket to the processing module.
3. The apparatus for managing memory according to claim 2, wherein the processing module is configured to determine, when the first UDP socket is received, the type of the received message as the application memory based on message type flag information indicating the application memory in the first UDP socket.
4. The apparatus for managing memory of claim 1 wherein the processing module is configured to store the memory application information in a log.
5. The apparatus for managing memory of claim 1 wherein the processing module is configured to generate a visualization chart as a statistical result based on the stored memory application information,
the device further comprises: a display module configured to display the visualization chart as the statistical result.
6. The apparatus for managing memory according to claim 1,
the acquisition module is configured to determine memory address information to be released when network auditing of the network message is finished, acquire time information during the determination as at least one of release time information, module type information of the network message after the network auditing is finished and call stack information of the network message after the network auditing is finished, and send the acquired release time information, at least one of the module type information of the network message after the network auditing is finished and the call stack information of the network message after the network auditing is finished, and the determined memory address information to be released as release memory address information and message type mark information indicating that the memory is to be released to the processing module;
the processing module is configured to acquire applied memory size information and applied time information corresponding to a network message of which network audit is finished and release a memory, and store the information sent to the processing module by the received acquisition module when the network audit of the network message is finished as memory release information corresponding to the network message.
7. The apparatus for managing memory according to claim 6, wherein the collecting module is configured to encapsulate at least one of the acquired release time information, the module type information of the network packet whose network audit is finished, and the call stack information of the network packet whose network audit is finished, and the determined memory address information to be released as the release memory address information and the message type flag information indicating that the memory is to be released, as the second UDP socket, and send the second UDP socket to the processing module.
8. The apparatus for managing memory of claim 7, wherein the processing module is configured to determine, upon receiving the second UDP socket, the type of the received message as the released memory based on message type flag information in the second UDP socket indicating the released memory.
9. The apparatus for managing memory of claim 6 wherein the processing module is configured to store the memory release information in a log.
10. The apparatus for managing memory of claim 6 wherein the processing module is configured to generate a visualization graph as a statistical result based on the stored memory release information,
the device further comprises: a display module configured to display the visualization chart as the statistical result.
11. A method for managing memory, the method comprising:
when a network message extracted for network audit is allocated with a memory, acquiring size information of the allocated memory and address information of the allocated memory, acquiring time information during allocation as at least one of application time information, module type information of the network message and call stack information of the network message, and sending at least one of the acquired application time information, the module type information of the network message and the call stack information of the network message, and the size information of the allocated memory as size information of the applied memory and the address information of the allocated memory as address information of the applied memory and message type mark information for indicating the applied memory;
determining application memory use range information and applying for a memory according to the transmitted application memory size information and application memory address information, and storing the transmitted information and the determined application memory use range information when the memory is allocated to the network message extracted for network audit as the memory application information corresponding to the network message.
12. The method for managing memory as claimed in claim 11,
the step of sending includes: and packaging at least one of the acquired application time information, the module type information of the network message and the call stack information of the network message, and the distributed memory size information as the applied memory size information, the distributed memory address information as the applied memory address information and the message type mark information indicating the applied memory as a first UDP socket, and sending the first UDP socket.
13. The method for managing memory as claimed in claim 12,
the step of applying for the memory comprises: and when the first UDP socket is received, determining the type of the received information as the application memory according to the message type mark information indicating the application memory in the first UDP socket.
14. The method of managing memory of claim 11, wherein the method further comprises:
and storing the memory application information in a log.
15. The method of managing memory of claim 11, wherein the method further comprises:
generating a visual chart according to the stored memory application information to be used as a statistical result;
and displaying a visual chart as a statistical result.
16. The method of managing memory of claim 11, wherein the method further comprises:
determining memory address information to be released when network auditing of a network message is finished, acquiring time information during determination as at least one of release time information, module type information of the network message after the network auditing is finished and call stack information of the network message after the network auditing is finished, and sending at least one of the acquired release time information, the module type information of the network message after the network auditing is finished and the call stack information of the network message after the network auditing is finished, and the determined memory address information to be released as release memory address information and message type mark information indicating that a memory is to be released;
acquiring the applied memory size information and the applied time information corresponding to the network message after the network audit is finished, releasing the memory, and storing and sending the information sent to the processing module by the acquisition module when the network audit is finished on the network message to be used as the memory release information corresponding to the network message.
17. The method for managing memory as claimed in claim 16,
the step of sending at least one of the obtained release time information, the module type information of the network message after the network audit is finished, the call stack information of the network message after the network audit is finished, and the determined memory address information to be released as the release memory address information and the message type mark information indicating the memory to be released comprises the following steps: and packaging at least one of the acquired release time information, the module type information of the network message after the network audit is finished and the call stack information of the network message after the network audit is finished, and the determined memory address information to be released as the release memory address information and the message type mark information indicating the memory to be released into a second UDP socket, and sending the second UDP socket.
18. The method for managing memory as claimed in claim 17,
the step of releasing the memory comprises the following steps: and when the second UDP socket is received, determining the type of the received information as the released memory according to the message type mark information which indicates the released memory in the second UDP socket.
19. The method of managing memory of claim 16, wherein the method further comprises:
and storing the memory release information in a log.
20. The method of managing memory of claim 16, wherein the method further comprises:
generating a visual chart according to the stored memory release information to serve as a statistical result;
and displaying a visual chart as a statistical result.
21. An electronic device, characterized in that the electronic device comprises:
at least one processor;
a memory coupled to the at least one processor, the memory storing instructions that, when executed by the at least one processor, cause the electronic device to perform the method of any of claims 11-20.
22. A non-transitory machine-readable medium having stored thereon computer-executable instructions that, when executed, cause at least one processor to perform the method of any one of claims 11 to 20.
23. A computer program product comprising computer-executable instructions that, when executed, cause at least one processor to perform the method of any one of claims 11 to 20.
CN202010132614.0A 2020-02-29 2020-02-29 Apparatus and method for managing memory Active CN113326120B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010132614.0A CN113326120B (en) 2020-02-29 2020-02-29 Apparatus and method for managing memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010132614.0A CN113326120B (en) 2020-02-29 2020-02-29 Apparatus and method for managing memory

Publications (2)

Publication Number Publication Date
CN113326120A true CN113326120A (en) 2021-08-31
CN113326120B CN113326120B (en) 2023-12-26

Family

ID=77412992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010132614.0A Active CN113326120B (en) 2020-02-29 2020-02-29 Apparatus and method for managing memory

Country Status (1)

Country Link
CN (1) CN113326120B (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101055533A (en) * 2007-05-28 2007-10-17 中兴通讯股份有限公司 Multithreading processor dynamic EMS memory management system and method
CN101178669A (en) * 2007-12-13 2008-05-14 华为技术有限公司 Resource recovery method and apparatus
WO2009114985A1 (en) * 2008-03-21 2009-09-24 中兴通讯股份有限公司 Memory leaking detecting device and method
US20110307828A1 (en) * 2010-06-11 2011-12-15 Microsoft Corporation Memory allocation visualization for unmanaged languages
US20120005448A1 (en) * 2010-06-30 2012-01-05 Ibm Corporation Demand-Based Memory Management of Non-pagable Data Storage
CN103064784A (en) * 2012-11-29 2013-04-24 福建师范大学 Memory leak detection method facing Xen environment during operation and implement system thereof
JP2013101665A (en) * 2013-01-15 2013-05-23 Hitachi Ltd Storage system
CN103237035A (en) * 2013-04-28 2013-08-07 哈尔滨工业大学 Controllable distributed agent platform
CN103729300A (en) * 2013-12-25 2014-04-16 华为技术有限公司 Method and related device for managing non-volatile memories
CN105260313A (en) * 2015-10-27 2016-01-20 上海斐讯数据通信技术有限公司 Memory leak checking system and method
CN105939327A (en) * 2016-01-19 2016-09-14 杭州迪普科技有限公司 Auditing log generation method and device
CN106997316A (en) * 2017-04-11 2017-08-01 上海联彤网络通讯技术有限公司 Detecting system and method that memory abnormal increases
CN107085548A (en) * 2016-02-16 2017-08-22 阿里巴巴集团控股有限公司 A kind of method, device and electronic equipment for monitoring application program internal memory
CN107436845A (en) * 2017-07-27 2017-12-05 南京华飞数据技术有限公司 A kind of Dram monitoring system and its monitoring method
WO2018018896A1 (en) * 2016-07-29 2018-02-01 华为技术有限公司 Memory management apparatus and method
CN109684232A (en) * 2018-10-23 2019-04-26 许继集团有限公司 A kind of Embedded Protocol Stack EMS memory management process
CN110704217A (en) * 2019-08-27 2020-01-17 努比亚技术有限公司 Memory leak detection method, terminal and computer readable storage medium

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101055533A (en) * 2007-05-28 2007-10-17 中兴通讯股份有限公司 Multithreading processor dynamic EMS memory management system and method
CN101178669A (en) * 2007-12-13 2008-05-14 华为技术有限公司 Resource recovery method and apparatus
WO2009114985A1 (en) * 2008-03-21 2009-09-24 中兴通讯股份有限公司 Memory leaking detecting device and method
US20110307828A1 (en) * 2010-06-11 2011-12-15 Microsoft Corporation Memory allocation visualization for unmanaged languages
US20120005448A1 (en) * 2010-06-30 2012-01-05 Ibm Corporation Demand-Based Memory Management of Non-pagable Data Storage
CN103064784A (en) * 2012-11-29 2013-04-24 福建师范大学 Memory leak detection method facing Xen environment during operation and implement system thereof
JP2013101665A (en) * 2013-01-15 2013-05-23 Hitachi Ltd Storage system
CN103237035A (en) * 2013-04-28 2013-08-07 哈尔滨工业大学 Controllable distributed agent platform
CN103729300A (en) * 2013-12-25 2014-04-16 华为技术有限公司 Method and related device for managing non-volatile memories
CN105260313A (en) * 2015-10-27 2016-01-20 上海斐讯数据通信技术有限公司 Memory leak checking system and method
CN105939327A (en) * 2016-01-19 2016-09-14 杭州迪普科技有限公司 Auditing log generation method and device
CN107085548A (en) * 2016-02-16 2017-08-22 阿里巴巴集团控股有限公司 A kind of method, device and electronic equipment for monitoring application program internal memory
WO2018018896A1 (en) * 2016-07-29 2018-02-01 华为技术有限公司 Memory management apparatus and method
CN106997316A (en) * 2017-04-11 2017-08-01 上海联彤网络通讯技术有限公司 Detecting system and method that memory abnormal increases
CN107436845A (en) * 2017-07-27 2017-12-05 南京华飞数据技术有限公司 A kind of Dram monitoring system and its monitoring method
CN109684232A (en) * 2018-10-23 2019-04-26 许继集团有限公司 A kind of Embedded Protocol Stack EMS memory management process
CN110704217A (en) * 2019-08-27 2020-01-17 努比亚技术有限公司 Memory leak detection method, terminal and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
VIJAY R. SONAWANE 等: "Visual Monitoring System Using Simple Network Management Protocol", 《2015 INTERNATIONAL CONFERENCE ON COMPUTATIONAL INTELLIGENCE AND COMMUNICATION NETWORKS (CICN)》, pages 197 - 200 *
张龙 等: "Linux内存管理图形化的研究与实现", 《电子设计工程》, vol. 22, no. 13, pages 72 - 74 *

Also Published As

Publication number Publication date
CN113326120B (en) 2023-12-26

Similar Documents

Publication Publication Date Title
WO2018103590A1 (en) Method, device, and system for assigning pickup tasks
CN110008021B (en) Memory management method, memory management device, electronic equipment and computer readable storage medium
JP2020173778A (en) Method, apparatus, electronic facility, computer readable medium, and computer program for allocating resource
US8660833B2 (en) Method, computer program product and apparatus for providing an interactive network simulator
CN109726983A (en) Examine method for allocating tasks, device, computer equipment and storage medium
CN108292162A (en) Software definition fifo buffer for multi-thread access
CN114223189B (en) Time length statistics method, device, electronic equipment and computer readable medium
CN106682167B (en) Statistical device and method for user behavior data
CN111984495A (en) Big data monitoring method and device and storage medium
CN111901405B (en) Multi-node monitoring method and device, electronic equipment and storage medium
CN113672375B (en) Resource allocation prediction method, device, equipment and storage medium
CN110784377A (en) Method for uniformly managing cloud monitoring data in multi-cloud environment
CN112631879A (en) Data acquisition method and device, computer readable medium and electronic equipment
CN111553592A (en) Task allocation method and device based on emotion information, computer equipment and medium
CN104407966B (en) Statistical system and method for memory object number of JVM (JAVA virtual machine)
CN107092556B (en) Test method, device and equipment
CN112488849A (en) Method and device for allocating salesman to orphan customer and electronic equipment
CN113326120B (en) Apparatus and method for managing memory
US10585620B2 (en) Storage monitoring system for monitoring components in a storage system in a distributed manner
CN116071123A (en) Commodity data processing method, commodity data processing system, electronic equipment and storage medium
CN113127327B (en) Test method and device for performance test
CN113835953A (en) Statistical method and device of job information, computer equipment and storage medium
CN113568967A (en) Dynamic extraction method of time sequence index data, electronic equipment and storage medium
CN113641628A (en) Data quality detection method, device, equipment and storage medium
CN109919470B (en) Method and device for distributing customer information

Legal Events

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