CN115292199A - Video memory leakage processing method and related device - Google Patents

Video memory leakage processing method and related device Download PDF

Info

Publication number
CN115292199A
CN115292199A CN202211154738.4A CN202211154738A CN115292199A CN 115292199 A CN115292199 A CN 115292199A CN 202211154738 A CN202211154738 A CN 202211154738A CN 115292199 A CN115292199 A CN 115292199A
Authority
CN
China
Prior art keywords
video memory
killing
memory
threshold
display
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
CN202211154738.4A
Other languages
Chinese (zh)
Other versions
CN115292199B (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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211154738.4A priority Critical patent/CN115292199B/en
Publication of CN115292199A publication Critical patent/CN115292199A/en
Application granted granted Critical
Publication of CN115292199B publication Critical patent/CN115292199B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application provides a method for processing video memory leakage and a related device, wherein the method comprises the following steps: acquiring information of a first process, wherein the first process is a process applying for video memory, and the information of the first process comprises the video memory occupied by the first process; and under the condition that the video memory occupied by the first process is larger than a first threshold value, the first process is killed. According to the method and the device, the influence on the user caused by the fact that the first process occupies too much video memory can be reduced, and the user experience is improved.

Description

Video memory leakage processing method and related device
Technical Field
The present application relates to the field of computers, and in particular, to a method and a related apparatus for processing memory leakage.
Background
With the rapid development of the short video industry and the game industry, applications such as video Applications (APPs) and game APPs that require a large amount of Graphics Processing Unit (GPU) memory are widely used. In the process of frequently using the APP, the problem that the APP continuously occupies the GPU video memory and is not timely released easily occurs, most of the GPU video memory can be occupied after a period of accumulation, the screen is frozen, the system is jammed and even restarted, and user experience is influenced.
Disclosure of Invention
The embodiment of the application discloses a processing method and a related device for memory leakage, which can be used for processing the memory leakage problem in the use process of electronic equipment and further solving the problems of screen freezing, system jamming or restarting and the like caused by memory leakage.
In a first aspect, the present application provides a method for processing a display memory leak, where the method includes:
acquiring information of a first process, wherein the first process is a process applying for video memory, and the information of the first process indicates the video memory occupied by the first process; and under the condition that the video memory occupied by the first process is larger than a first threshold value, the first process is killed.
According to the scheme, the information that the first process occupies the display memory is obtained, whether the display memory occupied by the first process is larger than a certain numerical value or not is judged, the first process meeting the searching and killing conditions is searched and killed, the influence on a user due to the fact that the first process occupies too much display memory can be reduced, and the user experience is improved.
In a possible implementation manner, the case that the video memory occupied by the first process is greater than the first threshold includes: the first process has the condition of memory leakage.
According to the scheme, whether the video memory occupied by the first process is larger than a first threshold value or not is judged, whether the video memory leakage occurs in the first process or not is judged, and the first process with the video memory leakage is searched and killed.
In a possible implementation manner, when the display memory occupied by the first process is greater than a first threshold, killing the first process includes: and under the condition that the display memory occupied by the first process is larger than a first threshold value and the residual available display memory of the system is smaller than a second threshold value, killing the first process.
According to the scheme, only under the condition that the residual available video memory of the system is insufficient, the first process occupying the video memory and larger than the first threshold value is killed. The method can avoid that the first process which is used or will be used by the user is killed under the condition that the residual available video memory of the system is sufficient, thereby reducing the influence on the user caused by killing the first process and improving the overall user experience.
In a possible implementation manner, the killing the first process includes:
sending first indication information to a display screen of electronic equipment, wherein the first indication information is used for indicating whether to check and kill the first process, and the electronic equipment is used for operating the first process;
acquiring a first instruction for searching and killing the first process through the display screen;
and killing the first process based on the first instruction.
According to the scheme, before the first process is checked and killed, the first process is sent to the display screen of the electronic equipment, so that a user can decide whether to check and kill the first process, sudden interruption and sudden flash retreat of an application program in the process of using the electronic equipment by the user are avoided, and the user experience is improved.
In a possible implementation manner, the first process runs in an electronic device, and the method further includes:
determining a second process in the electronic device under the condition that the video memory occupied by the first process is smaller than the first threshold and the remaining available video memory of the system is smaller than a third threshold; the second process is an inactive process or a process occupying most video memory in the electronic equipment; and killing the second process.
The scheme provides a solution for the condition that the residual video memory of the system is insufficient, but the video memory occupied by the first process does not meet the searching and killing condition of the first process. According to the scheme, all the first processes in the system are sequenced according to the activity or the occupation of the video memory, the inactive first process or the first process which occupies the most video memory is determined as the second process, the second process is checked and killed, and the interference caused by the insufficient display memory in the running process of the system is further avoided.
In a possible implementation manner, the second process is a process with the lowest activity level among a plurality of inactive processes in the electronic device.
The scheme provides a solution for the condition that the residual video memory of the system is insufficient, but the video memory occupied by the first process does not meet the searching and killing condition of the first process. According to the scheme, the first process with the lowest activity is judged to be the second process, the second process is checked and killed, and interference caused by insufficient video memory residue can be avoided in the running process of the system.
In one possible implementation, the killing the second process includes:
sending second indication information to a display screen of the electronic device, wherein the second indication information is used for indicating whether to check and kill the second process, and the electronic device is used for operating the second process;
acquiring a second instruction for searching and killing the second process through the display screen;
and checking and killing the second process based on the second instruction.
According to the scheme, before the second process is checked and killed, the second process is sent to the display screen of the electronic equipment, so that a user can decide whether to check and kill the second process, sudden interruption and flash retreat of an application program in the process of using the electronic equipment by the user are avoided, and the user experience is improved.
In a possible embodiment, the method further comprises: and sending the information of the first process to a cloud server.
According to the scheme, the information of the first process is sent to the cloud server, the change trend of the video memory occupied by the process along with time can be counted conveniently, and data support is provided for setting of the first threshold value.
In a possible embodiment, the method further comprises: the first threshold value is from a cloud server.
The maintenance personnel of the electronic equipment can store the preset first threshold value in the cloud server, and the electronic equipment can acquire the first threshold value through the cloud server.
The cloud server may also generate a first threshold corresponding to the first process according to a large amount of information of the first process, and the electronic device obtains the first threshold through the cloud server. The method for generating the first threshold corresponding to the first process by the cloud server may be, for example: the video memory occupied by a certain first process usually does not exceed 1GB, then the first threshold of the process can be set to 1GB, and when the video memory occupied by the first process exceeds 1GB, the video memory leakage can be judged to occur, and the first process can be checked and killed in time. Similarly, if the video memory occupied by a first process often exceeds 2GB, the first threshold of the process may be appropriately increased, and the frequency of the process being killed may be reduced.
In a second aspect, the present application provides a device for processing memory leak, where the device includes:
a second obtaining unit, configured to obtain information of a first process, where the first process is a process applying for video memory, and the information of the first process indicates video memory occupied by the first process;
and the checking and killing unit is used for checking and killing the first process under the condition that the video memory occupied by the first process is greater than a first threshold value.
In a possible implementation manner, the case that the video memory occupied by the first process is greater than the first threshold includes: the first process has the condition of memory leakage.
In a possible embodiment, the aforesaid checking and killing unit is specifically configured to: and under the condition that the display memory occupied by the first process is larger than a first threshold value and the residual available display memory of the system is smaller than a second threshold value, the first process is killed.
In a possible implementation manner, the aforesaid checking and killing unit is specifically configured to:
under the condition that the video memory occupied by the first process is larger than a first threshold value, sending first indication information to a display screen of electronic equipment, wherein the first indication information is used for indicating whether to check and kill the first process, and the electronic equipment is used for operating the first process; acquiring a first instruction for searching and killing the first process through the display screen; and killing the first process based on the first instruction.
In a possible embodiment, the aforesaid checking and killing unit is specifically configured to:
determining a second process in the electronic device under the condition that the video memory occupied by the first process is smaller than the first threshold and the remaining available video memory of the system is smaller than a third threshold; the second process is an inactive process or a process occupying most video memory in the electronic equipment; and killing the second process.
In a possible implementation manner, the aforesaid checking and killing unit is specifically configured to:
determining a second process in the electronic device under the condition that the video memory occupied by the first process is smaller than the first threshold and the remaining available video memory of the system is smaller than a third threshold; the second process is a process with the lowest activity among a plurality of inactive processes in the electronic device. And killing the second process.
In a possible implementation manner, the aforesaid checking and killing unit is specifically configured to:
sending second indication information to a display screen of the electronic device, wherein the second indication information is used for indicating whether to check and kill the second process, and the electronic device is used for operating the second process; acquiring a second instruction for searching and killing the second process through the display screen; and killing the second process according to the second instruction.
In a possible embodiment, the aforementioned apparatus further comprises: and the sending unit is used for sending the information of the first process to the cloud server.
In a possible embodiment, the aforementioned device further comprises: a first obtaining unit, configured to obtain the first threshold from a cloud server.
In a third aspect, a memory leakage processing apparatus is provided, which includes a processor and a memory. The processor is coupled to the memory, and when the processor executes the computer program stored in the memory, the method for processing the memory leak described in any of the first aspect above may be implemented. The apparatus may also include a communication interface for the apparatus to communicate with other apparatuses, which may be, for example, a transceiver, a circuit, a bus, a module, or other type of communication interface.
In one possible implementation, the apparatus may include:
a memory for storing a computer program;
the processor is used for acquiring information of a first process, wherein the first process is a process applying for video memory, and the information of the first process comprises the video memory occupied by the first process; and under the condition that the video memory occupied by the first process is greater than a first threshold value, checking and killing the first process.
In the present application, the computer program stored in the memory may be stored in advance, or may be downloaded from the internet when the apparatus is used, and the source of the computer program in the memory is not particularly limited in the present application. The indirect coupling or connection between the coupling devices, units or modules in the embodiments of the present application may be in an electrical, mechanical or other form, and is used for information interaction between the devices, units or modules.
In a fourth aspect, the present application provides an electronic device including the apparatus for processing memory leak according to the second or third aspect.
In a fifth aspect, the present application provides a computer-readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the method according to the first aspect or any one of the possible implementation manners of the first aspect.
In a sixth aspect, the present application provides a computer program product, which when executed by a processor, causes the method according to the first aspect or any one of the possible implementations of the first aspect to be performed.
The solutions provided in the second aspect to the sixth aspect are used for implementing or matching with the method correspondingly provided in the first aspect, so that the same or corresponding beneficial effects as those achieved by the method corresponding to the first aspect may be achieved, and details are not repeated here.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present application, the drawings required to be used in the embodiments or the background art of the present application will be described below.
Fig. 1 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a software structure of the electronic device 100 according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of memory leakage provided in the embodiment of the present application;
fig. 4A and fig. 4B are schematic diagrams illustrating a process of monitoring a memory leak according to an embodiment of the present application;
fig. 5A to 5D are schematic diagrams illustrating a process of monitoring memory leak according to an embodiment of the present application;
fig. 6A and fig. 6B are schematic diagrams illustrating a flow of processing a memory leak according to an embodiment of the present application;
fig. 7A to fig. 7G are schematic diagrams illustrating a process of processing a video memory leak according to an embodiment of the present application;
fig. 8A to 8H are schematic flowcharts of a killing process according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a logical structure of an apparatus provided in an embodiment of the present application;
fig. 10 is a schematic hardware structure diagram of an apparatus provided in an embodiment of the present application.
Detailed Description
The embodiments of the present application are described below with reference to the drawings.
The terminology used in the following examples of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of embodiments of the present application. As used in the description of the embodiments of the present application and the appended claims, the singular forms "a", "an", "the", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in the embodiments of this application refers to and encompasses any and all possible combinations of one or more of the listed items.
The following describes a terminal according to an embodiment of the present application.
Fig. 1 is a schematic structural diagram of an electronic device 100 disclosed in an embodiment of the present application.
The following describes an embodiment specifically by taking the electronic device 100 as an example. It should be understood that electronic device 100 may have more or fewer components than shown in FIG. 1, may combine two or more components, or may have a different configuration of components. The various components shown in fig. 1 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The electronic device 100 may include: the mobile terminal includes a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown in FIG. 1, or some components may be combined, some components may be split, or a different arrangement of components. The components shown in fig. 1 may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a graphics processor, an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the time sequence signal to finish the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a user takes a picture, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, an optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and converting into an image visible to the naked eye. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application (such as a face recognition function, a fingerprint recognition function, a mobile payment function, and the like) required by at least one function, and the like. The storage data area may store data created during the use of the electronic device 100 (such as face information template data, fingerprint information template, etc.), and the like. In addition, the internal memory 121 may include a high speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a Universal Flash Storage (UFS), and the like.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided via the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
In this embodiment, the electronic device 100 may execute the display method provided in this embodiment through the processor 110, and display a message or a prompt box obtained by the display method on the display screen 194.
The electronic device 100 may include, but is not limited to, any electronic product based on an intelligent operating system, which may interact with a user through an input device such as a keyboard, a virtual keyboard, a touch pad, a touch screen, and a voice control device. Such as smart phones, tablet personal computers (Tablet PCs), handheld computers, wearable electronics, personal Computers (PCs), desktop computers, and the like. The electronic devices may also include, but are not limited to, any of the internet of things (IoT) devices. The IoT devices may be, for example, smart speakers, televisions (TVs), in-vehicle displays of automobiles, and the like. The smart operating system includes, but is not limited to, any operating system that enriches device functionality by providing various applications to the device, such as an Android (Android), IOS, windows, MAC, or hong kong system (harmony os).
The software system of the electronic device 100 shown in fig. 1 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes a software system with a layered architecture as an example, and exemplifies a software structure of the electronic device 100. Fig. 2 illustrates a block diagram of a software structure of the electronic device 100 according to an embodiment of the present application.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the system is divided into four layers, which are an application layer, an application Framework layer (Framework), a Runtime (Runtime) and system library (Native), and a Kernel layer (Kernel), from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications (also referred to as applications) such as camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions of the electronic device 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application program to display notification information in a status bar or a preset designated location (for example, a message notification area described in this embodiment, which may be specifically described in the following description and is not described herein) and may be used to convey a notification type message, and the notification information may automatically disappear after a short stop without user interaction. Such as a notification manager used to notify download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog interface. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Runtime (Runtime) includes a core library and a virtual machine. Runtime is responsible for scheduling and management of the system.
The core library comprises two parts: one part is a function which needs to be called by a programming language (for example, java language), and the other part is a core library of the system.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes programming files (e.g., java files) of the application layer and the application framework layer as binary files. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), two-dimensional graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provides a fusion of two-Dimensional (2-Dimensional, 2D) and three-Dimensional (3-Dimensional, 3D) layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing 3D graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The following describes an exemplary workflow of the combination of software and hardware of the electronic device 100 in connection with capturing a photo scene.
When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is issued to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation, and the like). The raw input events are stored at the kernel layer. And the application program framework layer acquires the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and taking a control corresponding to the click operation as a control of a camera application icon as an example, the camera application calls an interface of an application framework layer, starts the camera application, further starts a camera drive by calling a kernel layer, and captures a still image or a video through the camera 193. This example is merely to illustrate the flow of the electronic device 100 in cooperation with software and hardware, and does not limit the present application.
For easy understanding of the memory leak, refer to fig. 3 exemplarily. The process 301 applies for the video memory from the GPU memory 302, the GPU memory 302 allocates the video memory for the process 301 to use, and when the process 301 uses the video memory completely, the phenomenon that the process 301 does not release the video memory in time or fails to release the video memory is called video memory leakage.
The process 301 is an abstract representation of the running process of a computer program, and is an instance of the program being run. From an implementation perspective, the process 301 is a data structure, and can clearly describe the internal rules of the dynamic operation of the computer system, and effectively manage and schedule the program entering the internal memory of the computer for operation. It should be understood that the process 301 refers to any process that is running in the system, a memory leak generally refers to a memory leak occurring in a single process, in the following description, the contents related to the processes refer to a single process, and if a plurality of threads occur, the description will be made otherwise.
Illustratively, the display driver receives a request for a video memory from the process 301, and the display driver evaluates the remaining video memory 303 of the GPU memory 302 through its video memory management unit. If the remaining video memory 303 can satisfy the requested video memory, the video memory management unit allocates video memory to the process 301 and allows the process to use the video memory. The allocated video memory, which GPU memory 302 cannot reallocate before process 301 is released, is represented by allocated video memory 304. After the process 301 uses the allocated video memory 304, the allocated video memory 304 is not used by the process 301 and needs to be released in time, however, in actual situations, the allocated video memory 304 has a phenomenon of being released in time or failing to release, which is called video memory leakage. When the display memory leakage occurs, the leaked display memory is not used by the process 301 and the GPU memory 302 at the same time, and the effective display memory amount in the GPU memory 302 is reduced. With the increase of the leakage of the video memory, the number of the effective video memory in the GPU memory 302 will be continuously reduced, and in a severe case, the process will be crashed, and the user side will have the phenomena of jamming, freezing the screen, and even restarting, etc.
The video memory management unit records the mapping relation between the virtual video memory address and the physical video memory address, and is used for managing the GPU memory and allocating the video memory to the thread.
The reasons for the leakage of the video memory are numerous, the video memory is classified according to the occurrence mode of the leakage of the video memory, and the leakage of the video memory can be divided into 4 types, including: implicit video memory leakage, frequent video memory leakage, sporadic video memory leakage, and one-time video memory leakage. The main reason for the leakage of the implicit video memory is that the video memory is not released in time, and the main reason for the leakage of the frequent video memory, the leakage of the accidental video memory and the leakage of the one-time video memory is that the release of the video memory fails.
Specifically, the implicit video memory leak means that a process continuously applies for video memory during running, and occupied video memory is released until the process runs, so that a large amount of video memory is occupied in a running period of each process. Illustratively, the process sends a request for applying for the video memory, the display driver receives the request, and the display driver allocates the video memory to the process through the video memory management unit of the display driver. The process does not have a program for actively releasing the video memory, so that the process cannot release the video memory after the process uses the part of the video memory, and the video memory occupied by the process is released only after the process is finished.
The frequently leaked video memory refers to that a process executes a code with the leaked video memory for multiple times in the running process, each execution can cause leakage of one video memory, and the current process occupies a large amount of video memory along with the increase of the execution times. Illustratively, the process sends a request for applying for the video memory, the display driver receives the request, and the display driver allocates the video memory to the process through the video memory management unit of the display driver. A certain section of code of the process does not have a program for actively releasing the video memory or has the possibility of failure in releasing the video memory, and the section of code is repeatedly executed in the process of running the process, so that a phenomenon that a large amount of video memory is occupied is called as frequent video memory leakage.
The sporadic memory leak refers to the phenomenon that the memory leak occurs only in certain specific environments or operation processes. The sporadic memory leak and the frequent memory leak are relative, and in a specific environment or operation process, the sporadic memory leak may become the frequent memory leak, and the frequent memory leak may also become the sporadic memory leak. Illustratively, the reasons for the sporadic memory leak and the frequent memory leak are the same, and are not described in detail here. The accidental memory leak and the frequent memory leak are different in that when the accidental memory leak occurs, the frequency of executing the memory leak code in the process is less than that of the frequent memory leak.
The disposable memory leak means that some codes with memory leak are only run once in the process of running the process, and therefore a memory leak always exists in the process of running the process. Illustratively, the process sends a request for applying for the video memory, the display driver receives the request, and the display driver allocates the video memory to the process through the video memory management unit of the display driver. The phenomenon that at least one section of code in a process is subjected to video memory leakage and the section of code is executed by the process certainly, so that one piece of video memory leakage always exists in the process running process is called as one-time video memory leakage.
The occurrence of implicit display memory leakage, frequent display memory leakage, accidental display memory leakage and one-time display memory leakage can cause the waste of display memory resources, affect the normal operation of programs under severe conditions, cause system crash, and cause phenomena of blocking, screen freezing and even restarting and the like at a user side.
However, the existing memory leak monitoring and processing scheme is implemented basically for programming languages and local layers, the application of the GPU memory is distributed and managed by an independent driver, and the existing scheme cannot be used for monitoring and processing the GPU memory leak. Therefore, the application provides a monitoring scheme aiming at the display memory leakage of the electronic equipment and a processing scheme for discovering the display memory leakage, and is used for solving the problem that the display memory leakage of the GPU influences the use experience of the user of the electronic equipment.
The following describes a method for processing a video memory leak provided by an embodiment of the present application, for monitoring a size of a video memory occupied by a thread, referring to fig. 4A as an example, the method includes, but is not limited to, the following steps:
and S4A01, applying for the video memory from the display driver by the process.
The kernel layer in the operating system is responsible for managing and allocating hardware resources, and when a process initiates a video memory application, the kernel layer is required to process the video memory application. The process applies for the video memory through a video memory application function, for example, a video memory allocation (malloc) function is used to apply for the video memory, and the usage of the malloc function is "malloc + size of the video memory to be applied".
The process may be a process corresponding to an application, for example, a process formed in an operation process of an application such as WeChat, microblog, taobao, and the like.
Illustratively, when a process needs to apply for 5MB of video memory in the running process, the process applies for the video memory in a malloc (5 MB) manner, and finally completes the processing of the application by the display driver in the kernel layer.
And S4A02, displaying the video memory occupied by the driving monitoring process.
When the display driver monitors the process to apply for the video memory, the display driver monitors the process and acquires the video memory occupied by the process. For example, the occupied video memory may refer to a specific video memory value, an occupied percentage, and the like, for example: occupy 2GB video memory or occupy 20% video memory, etc., and the application is not limited.
In a possible implementation manner, the display driver monitors the process application video memory, and may further obtain the name of the process, the identification code of the process, and the time for the process to apply the video memory.
And S4A03, the display driver allocates the video memory to the process according to the size of the video memory applied by the process.
Illustratively, the display driver returns the video memory first address allocated to the process through the video memory management unit of the display driver according to the information of the process application video memory.
And S4A04, writing the video memory occupied by the process into the first file node by the display driver.
For example, the first file node may be created by the system at the time of boot start, the name of the first file node may be "display leak report", and the location where the first file node is stored may be "/system/kernel layer/display status report/first file node". The naming of the first node and the specific location of storage is not a limitation of the present application. When the display driver monitors that the process applies for the video memory, the video memory occupied by the process is written into the first file node.
In a possible implementation manner, the display driver monitors that the process applies for the video memory, and may also write the name of the process, the identification code of the process, and the time when the process applies for the video memory into the first file node.
S4A05, monitoring a first file node generated by a display driver by a video memory leakage monitoring tool, and judging whether video memory leakage occurs in the process.
The video memory leakage monitoring tool monitors the first file node and judges whether video memory leakage occurs in the process according to the monitored data of the first file node. The method of monitoring may be using a monitoring function, e.g. using a fetch (poll) function, etc.
According to a possible implementation mode, the video memory leakage monitoring tool monitors data of the first file node in real time through a poll function. Illustratively, the video memory leakage monitoring tool monitors the first file node in real time through a poll function, immediately analyzes and compares the data of the first file node if the data of the first file node changes, and executes subsequent actions according to a judgment result.
The method for judging whether the process corresponding to the first file node has the video memory leakage is to compare the value of the video memory occupied by the process in the first file node monitored with the first threshold. And if the numerical value of the video memory occupied by the process is smaller than the first threshold, the video memory leakage does not occur in the process. And if the value of the video memory occupied by the process is greater than the first threshold value, the process leaks the video memory.
The value range of the first threshold is greater than 0 and less than the maximum available video memory of the display memory, and may be one-half of the maximum available video memory, one-fourth of the maximum available video memory, and the like, which is not limited in the present application. The setting of the first threshold includes, but is not limited to, the following methods:
an implementable manner is to set the first threshold value through a configuration information item (prop) of the mobile phone, and the method can be set by a mobile phone provider when the mobile phone leaves a factory, and the mobile phone provider can also update the first threshold value through a system updating manner in the process of using by a user. It is understood that the above system updating manner includes that the terminal device obtains data from the server for updating the first threshold, and different processes may set different first thresholds.
An implementable mode is that a display driver dynamically sets a first threshold according to the use habit of a mobile phone user, the characteristics of the process, the size of the residual video memory and other information. Exemplarily, the following steps are carried out: when a mobile phone user uses a mobile phone, the use frequency of a certain process is the highest, and the first threshold corresponding to the process is dynamically increased. By way of example: when a mobile phone user uses the mobile phone, only a few processes are operated, and the residual video memory is sufficient, the first threshold values corresponding to the processes are dynamically increased. Exemplarily, the following steps are carried out: when a certain process is in operation, the demand for the video memory is large, and the first threshold corresponding to the process can be dynamically increased. Exemplarily, the following steps are carried out: the software application corresponding to a certain process is set with a higher priority by the mobile phone, so that the first threshold corresponding to the process can be dynamically increased.
In one possible embodiment, see fig. 4B for example. Fig. 4B differs from fig. 4A in that fig. 4B adds a function of uploading logs compared to fig. 4A.
And S4B01, applying for the video memory from the display driver by the process. For a specific implementation process, please refer to the step S4a01, which will not be described here.
And S4B02, displaying the video memory occupied by the monitoring process of the driver. For a specific implementation process, please refer to step S4a01, which will not be described herein.
And S4B03, the display driver allocates the video memory to the process according to the size of the video memory applied by the process. For a specific implementation process, please refer to the step S4a01, which will not be described here.
And S4B04, writing the video memory occupied by the process into the first file node by the display driver. For a specific implementation process, please refer to step S4a01, which will not be described herein.
And S4B05, monitoring the first file node generated by the display driver by the video memory leakage monitoring tool, and judging whether the video memory leakage occurs in the process. For a specific implementation process, please refer to step S4a01, which will not be described herein.
And S4B06, generating and uploading a log of which the process occupies the video memory.
According to a possible implementation mode, the video memory leakage monitoring tool monitors that data recorded by the first file node changes, and a log submodule of the video memory leakage monitoring tool generates a log according to the data of the first file node and uploads a log file to the cloud server.
Illustratively, the memory leak monitoring tool monitors that data recorded by the first file node changes, and sends the information to the log submodule. And after receiving the information that the data recorded by the first file node changes, the log submodule captures the data recorded by the first file node, generates a log according to the data, and uploads the log to the cloud server.
In an implementation manner, referring to fig. 5A for example, a method for processing a memory leak is provided. The difference between fig. 5A and fig. 4A is that, after the display driver monitors the video memory occupied by the process, the method provided in fig. 5A needs to determine whether to write the video memory of the process into the first file node by determining whether the video memory occupied by the process is greater than the first threshold. The method includes, but is not limited to, the steps of:
and S5A01, applying for the display memory from the process to the display driver.
The kernel layer in the operating system is responsible for managing and allocating hardware resources, and when a process initiates a video memory application, the kernel layer is required to process the video memory application. The process applies for the video memory through a video memory application function, for example, a video memory allocation (malloc) function is used to apply for the video memory, and the usage of the malloc function is "malloc + size of the video memory to be applied".
The process may be a process corresponding to an application, for example, a process formed in an operation process of an application such as WeChat, microblog, taobao, and the like. For a specific implementation process, please refer to the step S4a01, which will not be described here.
And S5A02, displaying the video memory occupied by the monitoring process of the driver.
When the display driver monitors the process to apply for the video memory, the display driver monitors the process and acquires the video memory occupied by the process.
In a possible implementation manner, the display driver monitors the process application video memory, and may further obtain the name of the process, the identification code of the process, and the time for the process to apply the video memory.
And S5A03, the display driver judges whether the video memory occupied by the current process is larger than a first threshold value.
The value range of the first threshold is greater than 0 and less than the maximum available video memory of the display memory, and may be one-half of the maximum available video memory, one-fourth of the maximum available video memory, and the like. The setting of the value of the first threshold includes, but is not limited to, the following methods:
an implementable manner is that the first threshold is set through a configuration information item (prop) of the mobile phone, and this method may be set by a mobile phone provider when the mobile phone leaves a factory, and the mobile phone provider may also update the first threshold in a system updating manner during the use of the user. It is understood that the above system updating manner includes that the terminal device obtains data from the server for updating the foregoing first threshold, and different processes may set different first thresholds.
An implementable mode is that a display driver dynamically sets a first threshold according to the use habit of a mobile phone user, the characteristics of the process, the size of the residual video memory and other information. Exemplarily, the following steps are carried out: when a mobile phone user uses a mobile phone, the first threshold corresponding to a process is dynamically increased when the use frequency of the process is the highest. Exemplarily, the following steps are carried out: when a mobile phone user uses the mobile phone, only a few processes are operated, and the residual video memory is sufficient, the first threshold values corresponding to the processes are dynamically increased. Exemplarily, the following steps are carried out: when a process is in operation, the demand for the video memory is large, and the first threshold corresponding to the process can be dynamically increased. Exemplarily, the following steps are carried out: the software application corresponding to a certain process is set with a higher priority by the mobile phone, so that the first threshold corresponding to the process can be dynamically increased.
When the display driver receives a request for applying for the video memory from the process, the video memory management unit of the display driver monitors the value of the video memory occupied by the current thread through step S5a02, and determines the magnitude relation between the value of the video memory and the set first threshold.
And S5A04, the display driver allocates the video memory to the process according to the size of the video memory applied by the process.
Illustratively, the display driver returns, by its video memory management unit, the video memory head address allocated to the process according to the information that the process applies for the video memory.
And S5A05, writing the video memory occupied by the process into the first file node under the condition that the video memory occupied by the process is larger than the first threshold value.
For example, the first file node may be created by the system at the time of startup, the name of the first file node may be "memory leak report", and the location where the first file node is stored may be "/system/kernel layer/memory status report/first file node". When the display driver monitors that the process applies for the video memory and the judgment result of the step S5a03 is that the video memory occupied by the process is greater than the first threshold, the video memory occupied by the process is written into the first file node.
In a possible implementation manner, when the display driver monitors that the process applies for the video memory and the determination result of step S5a03 is that the video memory occupied by the process is greater than the first threshold, the name of the process, the identification code of the process, and the time for which the process applies for the video memory may also be written into the first file node.
And S5A06, monitoring the first file node generated by the display driver by the display memory leakage monitoring tool.
The video memory leakage monitoring tool monitors the first file node. The method of monitoring may be using a monitoring function, e.g. using a fetch (poll) function, etc.
In a possible implementation manner, the memory leak monitoring tool monitors data of the first file node in real time through a poll function. Illustratively, the video memory leakage monitoring tool monitors the first file node in real time through a poll function, and if data of the first file node changes, the data of the first file node is immediately acquired.
Fig. 5B is a flowchart illustrating a process applying for a video memory according to an embodiment of the method shown in fig. 5A, where fig. 5B includes two parts, a user mode and a kernel mode, where the user mode corresponds to the application layer in fig. 2, and the kernel mode refers to the application framework layer, the system library, the runtime layer and the kernel layer in fig. 2.
And the process of the user mode initiates a video memory application to the kernel mode, which is equivalent to the step S5A01 that the process applies for the video memory to the display driver.
The kernel state determines whether the video memory occupied by the current process is greater than 4GB, which is equivalent to the step S5a03 that the display driver determines whether the video memory occupied by the current process is greater than the first threshold.
And if the video memory occupied by the current process is more than 4GB, generating a video memory leakage report, wherein the video memory leakage report comprises the process identification code, the video memory occupied by the process and the name of the process. In step S5a05, when the video memory occupied by the process is greater than the first threshold, the video memory occupied by the process is written into the first file node.
In one possible embodiment, see, for example, fig. 5C. Fig. 5C is different from fig. 5A in that a function of uploading a log is added in fig. 5C.
And S5C01, applying for the display memory from the display driver by the process. For a specific implementation process, please refer to step S5a01, which will not be described herein.
And S5C02, displaying the video memory occupied by the monitoring process of the driver. For a specific implementation process, please refer to the step S5a02, which will not be described here.
And S5C03, the display driver judges whether the video memory occupied by the current process is larger than a first threshold value. For a specific implementation process, please refer to the step S5a03, which will not be described here.
And S5C04, the display driver allocates the video memory to the process according to the size of the video memory applied by the process. For a specific implementation process, please refer to step S5a04, which will not be described here.
And S5C05, writing the video memory occupied by the process into the first file node under the condition that the video memory occupied by the process is larger than the first threshold. For a specific implementation process, please refer to step S5a05, which will not be described herein.
And S5C06, monitoring the first file node generated by the display driver by the display memory leakage monitoring tool. For a specific implementation process, please refer to step S5a06, which will not be described herein.
And S5C07, generating and uploading a log of which the progress occupies the video memory.
According to a possible implementation mode, the video memory leakage monitoring tool monitors that data recorded by a first file node changes, and a log submodule of the video memory leakage monitoring tool generates a log file according to the data of the first file node and uploads the log file to a cloud server.
Illustratively, the monitor tool monitors that the data recorded by the first file node changes, and a log submodule of the monitor tool sends the information. After receiving the information that the data recorded by the first file node changes, the log module captures the data recorded by the first file node, generates a log according to the data, and uploads the log to the cloud server.
As shown in fig. 5D, a specific embodiment of monitoring memory leaks is provided. The display driver in the kernel layer monitors the video memory occupied by the process through the abnormal video memory monitoring module and sends the monitored abnormal video memory information to the video memory leakage reporting module. Then, the video memory leakage reporting module stores the received video memory abnormal information into a video memory leakage report, and stores the video memory leakage report into a/system/kernel layer/video memory state report folder. And finally, monitoring the video memory leakage report by the video memory leakage monitoring tool, processing data in the video memory leakage report to form a video memory leakage log, and uploading the video memory leakage log to a cloud server.
The abnormal video memory monitoring module monitors the video memory occupied by the process. Corresponding to the step S5C02 displaying the video memory occupied by the driver monitoring process.
The video memory exception information corresponds to a case where the video memory occupied by the process in step S5C05 is greater than the first threshold.
The video memory leakage reporting module stores the received video memory abnormal information into a video memory leakage report, and stores the video memory leakage report into a folder of a system/kernel layer/video memory state report, which is equivalent to step S5C05 for writing the video memory occupied by the process into the first file node.
The video memory leakage monitoring tool monitors the video memory leakage report, and is equivalent to the step S5C06 that the video memory leakage monitoring tool monitors the first file node generated by the display driver.
And forming a video memory leakage log, uploading the log to a cloud server, which is equivalent to generating and uploading the log of the video memory occupied by the process in the step S5C 07.
In a possible implementation manner, referring to fig. 6A for example, a method for processing a video memory leak is provided, which adds a function of checking a progress of the video memory leak to the method shown in fig. 5A, and includes, but is not limited to the following steps:
and S6A01, applying for the display memory from the process to the display driver.
The kernel layer in the operating system is responsible for managing and allocating hardware resources, and when a process initiates a video memory application, the kernel layer is required to process the video memory application. The process applies for the video memory through a video memory application function, for example, a video memory allocation (malloc) function is used to apply for the video memory, and the usage of the malloc function is "malloc + size of the video memory to be applied".
The process may be a process corresponding to an application, for example, a process formed in an operation process of an application such as WeChat, microblog or Taobao. For a specific implementation process, please refer to the step S4a01, which will not be described here.
And S6A02, displaying the video memory occupied by the monitoring process of the driver.
When the display driver monitors the process to apply for the video memory, the display driver monitors the process and acquires the video memory occupied by the process.
In a possible implementation manner, the display driver monitors that the process applies for the video memory, and may further obtain a name of the process, an identification code of the process, and a time when the process applies for the video memory.
And S6A03, the display driver allocates the video memory to the process according to the size of the video memory applied by the process.
Illustratively, the display driver returns the video memory first address allocated to the process through the video memory management unit of the display driver according to the information of the process application video memory.
And S6A04, writing the video memory occupied by the process into the first file node by the display driver.
For example, the first file node may be created by the system at the time of boot start, the name of the first file node may be "display leak report", and the location where the first file node is stored may be "/system/kernel layer/display status report/first file node". The naming of the first node and the specific location of storage is not a limitation of the present application. When the display driver monitors that the process applies for the video memory, the video memory occupied by the process is written into the first file node.
In a possible implementation manner, the display driver monitors that the process applies for the video memory, and may also write the name of the process, the identification code of the process, and the time when the process applies for the video memory into the first file node.
S6A05, the video memory leakage monitoring tool monitors the first file node generated by the display driver and judges whether the video memory leakage occurs in the process.
The video memory leakage monitoring tool monitors the first file node and judges whether video memory leakage occurs in the process according to the monitored data of the first file node. The method of monitoring may be using a monitoring function, e.g. using a fetch (poll) function, etc.
In a possible implementation manner, the memory leak monitoring tool monitors data of the first file node in real time through a poll function. Illustratively, the video memory leakage monitoring tool monitors the first file node in real time through a poll function, and if the data of the first file node changes, the data of the first file node is analyzed and compared immediately, and subsequent actions are executed according to the judgment result.
The method for judging whether the process corresponding to the first file node has the video memory leakage is to compare the numerical value of the video memory occupied by the process in the first file node monitored with the first threshold. And if the numerical value of the video memory occupied by the process is smaller than the first threshold, the video memory leakage does not occur in the process. And if the numerical value of the video memory occupied by the process is greater than the first threshold value, the video memory leakage of the process occurs.
The value range of the first threshold is greater than 0 and less than the maximum available video memory of the display memory, and may be one-half of the maximum available video memory, one-fourth of the maximum available video memory, and the like. The setting of the value of the first threshold includes, but is not limited to, the following methods:
an implementable manner is to set the first threshold value through a configuration information item (prop) of the mobile phone, and the method can be set by a mobile phone provider when the mobile phone leaves a factory, and the mobile phone provider can also update the first threshold value through a system updating manner in the process of using by a user. It is understood that the above system updating manner includes that the terminal device obtains data from the server for updating the first threshold, and different processes may set different first thresholds.
An implementable mode is that the display drive dynamically sets the first threshold according to the using habit, the characteristics of the process and the size of the residual video memory of the mobile phone user. Exemplarily, the following steps are carried out: when a mobile phone user uses a mobile phone, the use frequency of a certain process is the highest, and the first threshold corresponding to the process is dynamically increased. By way of example: when a mobile phone user uses the mobile phone, only a few processes are operated, and the residual video memory is sufficient, the first threshold values corresponding to the processes are dynamically increased. By way of example: when a process is in operation, the demand for the video memory is large, and the first threshold corresponding to the process can be dynamically increased. Exemplarily, the following steps are carried out: the software application corresponding to a certain process is set with a higher priority by the mobile phone, so that the first threshold corresponding to the process can be dynamically increased.
And S6A06, when the video memory occupied by the process is larger than the first threshold value, modifying the second file node by the video memory leakage monitoring tool.
For example, the second file node may be created by a display controller (memecg) at the time of booting, the name of the second file node may be "display error node", and the location where the second file node is stored may be "/device/display controller/application/package name/second file node". The naming of the second file node and the specific storage location are not limited in this application. The second file node is configured to identify whether the process has a memory leak, and exemplarily, if the value of the second file node is "0", it indicates that the process has a memory leak, and if the value of the second file node is "1", it indicates that the process has no memory leak. How the second node identifies whether the process has the memory leak or not is not limited in the present application.
In a possible implementation manner, when the judgment result in the step S6a05 is that the process has a memory leak, the memory leak monitoring tool modifies the value of the second file node to an identifier corresponding to the memory leak occurring in the process. Illustratively, the second file node uses "1" to indicate that no memory leak has occurred to the process; the use of "0" indicates that the process has a memory leak. And when the video memory occupied by the process is larger than the first threshold value, modifying the value of the second file node from '1' to '0', which indicates that the process has video memory leakage.
And S6A07, a process searching and killing module monitors a second file node.
In one possible implementation, the scheduling submodule in the process killing module regularly monitors the data of the second file node. The above-mentioned period may be 1 minute, 2 minutes or 5 minutes, and the present application is not limited thereto. Illustratively, the scheduling module monitors the second file node once every 5 minutes, and if the data of the second file node is monitored to be changed, the data of the second file node is analyzed and compared, and subsequent actions are executed according to the judgment result.
And S6A08, a process searching and killing module is used for searching and killing the process.
In a possible implementation manner, when the scheduling sub-module of the process killing module monitors that the data of the second file node indicates that the display memory leakage of the process occurs, the process killing module starts the process killing program to kill the process. Illustratively, when the scheduling submodule of the process killing module monitors that the process with the identification code of "123456" has the display memory leakage, the process killing module starts a process killing program to kill the process through a killing (kill) function. One use mode of the kill function is "kill + process identification code", and the killing of the process with the process identification code of "123456" can be performed in an exemplary mode of "kill + 123456".
And S6A09, after the process is checked and killed, the display memory leakage monitoring tool modifies the second file node.
After the process killing is completed, the process killing module sends the information of the completion of the killing to the video memory leakage monitoring module. And the video memory leakage monitoring tool modifies the value of the second file node into an identifier corresponding to the video memory leakage which does not occur in the process. Illustratively, the second file node uses "1" to indicate that no memory leak has occurred to the process; the use of "0" indicates that the process has a memory leak. And when the video memory occupied by the process is larger than the first threshold value, modifying the value of the second file node from '0' to '1', which indicates that the process has no video memory leakage.
In one possible embodiment, see, for example, fig. 6B. Fig. 6B differs from fig. 6A in that fig. 6B adds the function of uploading logs, including but not limited to the following steps:
and S6B01, applying for video memory from the display driver by the process. For a specific implementation process, please refer to the step S6a01, which will not be described here.
And S6B02, displaying the video memory occupied by the driving monitoring process. For a specific implementation process, please refer to step S6a02, which will not be described herein.
And S6B03, the display driver allocates the video memory to the process according to the size of the video memory applied by the process. For a specific implementation process, please refer to step S6a03, which is not described herein.
And S6B04, writing the video memory occupied by the process into the first file node by the display driver. For a specific implementation process, please refer to step S6a04, which will not be described here.
S6B05, the video memory leakage monitoring tool monitors the first file node generated by the display driver and judges whether the video memory leakage occurs in the process. For a specific implementation process, please refer to step S6a05, which will not be described herein.
And S6B06, generating and uploading a log of the video memory occupied by the process by the video memory leakage monitoring tool.
According to a possible implementation mode, the video memory leakage monitoring tool monitors that data recorded by the first file node changes, and a log submodule of the video memory leakage monitoring tool generates a log file according to the data of the first file node and uploads the log file to the cloud server. For a specific implementation process, please refer to step S5C07, which will not be described here.
And S6B07, when the video memory occupied by the process is larger than a first threshold value, modifying the second file node by the video memory leakage monitoring tool. For a specific implementation process, please refer to step S6a06, which will not be described herein.
And S6B08, a process searching and killing module monitors a second file node. For a specific implementation process, please refer to step S6a07, which will not be described here.
And S6B09, the process searching and killing module searches and kills the process. For a specific implementation process, please refer to the above step S6a08, which will not be described here.
And S6B10, when the process is checked and killed, modifying the second file node by the display memory leakage monitoring tool. For a specific implementation process, please refer to step S6a09 described above, which will not be described herein.
And S6B11, the process killing module generates and uploads a log of process video memory leakage.
In a possible implementation manner, after the process is completely killed in step S6B10, the name and the identification code of the killed process, the occupied display memory, and the display memory available to the system after killing are sent to the log submodule of the process killing module. And the log submodule generates a log according to the data and uploads the log to the cloud server.
In an implementation manner, referring to fig. 7A for example, a method for processing a memory leak is provided. The difference between fig. 7A and fig. 6A is that, after the display driver monitors the video memory occupied by the process, the method provided in fig. 7A needs to determine whether to write the video memory of the process into the first file node by determining whether the video memory occupied by the process is greater than the first threshold. The method includes, but is not limited to, the steps of:
and S7A01, applying for the display memory from the process to the display driver.
The kernel layer in the operating system is responsible for managing and allocating hardware resources, and when a process initiates a video memory application, the kernel layer is required to process the video memory application. The process applies for the video memory through a video memory application function, for example, a video memory allocation (malloc) function is used to apply for the video memory, and the usage of the malloc function is "malloc + size of the video memory to be applied".
The process may be a process corresponding to an application, for example, a process formed in an operation process of an application such as WeChat, microblog or Taobao. For a specific implementation process, please refer to step S4a01, which will not be described herein.
And S7A02, displaying the video memory occupied by the monitoring process of the driver.
When the display driver monitors the process to apply for the video memory, the display driver monitors the process and acquires the video memory occupied by the process.
In a possible implementation manner, the display driver monitors that the process applies for the video memory, and may further obtain a name of the process, an identification code of the process, and a time when the process applies for the video memory.
And S7A03, the display driver judges whether the video memory occupied by the current process is larger than a first threshold value.
The value range of the first threshold is greater than 0 and less than the maximum available video memory of the display memory, and may be one-half of the maximum available video memory, one-fourth of the maximum available video memory, and the like. The setting of the value of the first threshold includes, but is not limited to, the following methods:
an implementable manner is to set the first threshold value through a configuration information item (prop) of the mobile phone, and the method can be set by a mobile phone provider when the mobile phone leaves a factory, and the mobile phone provider can also update the first threshold value through a system updating manner in the process of using by a user. It is understood that the above system updating manner includes that the terminal device obtains data from the server for updating the first threshold, and different processes may set different first thresholds.
An implementable mode is that a display driver dynamically sets a first threshold according to the use habit of a mobile phone user, the characteristics of the process, the size of the residual video memory and other information. By way of example: when a mobile phone user uses a mobile phone, the use frequency of a certain process is the highest, and the first threshold corresponding to the process is dynamically increased. By way of example: when a mobile phone user uses the mobile phone, only a small number of processes are running and the remaining video memory is sufficient, and the first threshold values corresponding to the processes are dynamically increased. Exemplarily, the following steps are carried out: when a process is in operation, the demand for the video memory is large, and the first threshold corresponding to the process can be dynamically increased. By way of example: the software application corresponding to a certain process is set with a higher priority by the mobile phone, so that the first threshold corresponding to the process can be dynamically increased.
Before the display memory is allocated by the display memory management unit of the display driver, the number of the display memory occupied by the current thread is monitored through step S7a02, and the magnitude relation between the number of the display memory and the set first threshold is determined.
And S7A04, the display driver allocates the video memory to the process according to the size of the video memory applied by the process.
Illustratively, the display driver returns the video memory first address allocated to the process through the video memory management unit of the display driver according to the information of the process application video memory.
And S7A05, under the condition that the video memory occupied by the process is larger than the first threshold value, the display driver writes the video memory occupied by the process into the first file node.
For example, the first file node may be created by the system at the time of boot start, the name of the first file node may be "display leak report", and the location where the first file node is stored may be "/system/kernel layer/display status report/first file node". When the display driver monitors that the process applies for the video memory and the judgment result of the step S7a03 is that the video memory occupied by the process is greater than the first threshold, the video memory occupied by the process is written into the first file node.
In a possible implementation manner, when the display driver monitors that the process applies for the video memory and the determination result of step S7a03 is that the video memory occupied by the process is greater than the first threshold, the name of the process, the identification code of the process, and the time for which the process applies for the video memory may also be written into the first file node.
And S7A06, monitoring the first file node generated by the display driver by the display memory leakage monitoring tool.
The video memory leakage monitoring tool monitors the first file node. The method of monitoring may be using a monitoring function, e.g. using a fetch (poll) function, etc.
According to a possible implementation mode, the video memory leakage monitoring tool monitors data of the first file node in real time through a poll function. Illustratively, the monitor tool monitors the first file node in real time through a poll function, and if data of the first file node changes, executes subsequent actions.
And S7A07, when the first file node is changed, modifying the second file node by the video memory leakage monitoring tool.
For example, the second file node may be created by the display controller at the time of booting, the name of the second file node may be "display error node", and the location where the second file node is stored may be "/device/display controller/application/package name/second file node". The naming of the second file node and the specific storage location are not limited in this application. The second file node is configured to identify whether the process has a memory leak, and exemplarily, if the value of the second file node is "0", it indicates that the process has a memory leak, and if the value of the second file node is "1", it indicates that the process has no memory leak. How the second node identifies whether the process has memory leakage or not is not limited in the present application.
In a possible implementation manner, when the monitor tool monitors that the data of the first file node changes, the monitor tool modifies the value of the second file node into an identifier corresponding to the occurrence of the memory leak in the process. Illustratively, the second file node uses "1" to indicate that no memory leak has occurred to the process; the use of "0" indicates that a process has a memory leak. And when the video memory occupied by the process is larger than the first threshold value, modifying the value of the second file node from '1' to '0', which indicates that the process has video memory leakage.
And S7A08, monitoring a second file node by the process searching and killing module.
In one possible implementation, the scheduling submodule in the process killing module regularly monitors the data of the second file node. The above-mentioned period may be 1 minute, 2 minutes or 5 minutes, and the present application is not limited thereto. Illustratively, the scheduling module monitors the second file node every 5 minutes, and if the data of the second file node is monitored to be changed, the data of the second file node is analyzed and compared, and subsequent actions are executed according to the judgment result.
And S7A09, the process searching and killing module searches and kills the process.
According to a possible implementation manner, when the scheduling submodule of the process searching and killing module monitors that the data of the second file node indicates that the process has the display memory leakage, the process searching and killing module starts the process searching and killing program to search and kill the process. Illustratively, when the scheduling submodule of the process killing module monitors that the process with the identification code of "123456" has the display memory leakage, the process killing module starts a process killing program to kill the process through a killing (kill) function. Wherein, one usage mode of the kill function is "kill + process identification code", and the killing process identification code is "123456", which can be exemplarily performed by "kill + 123456".
And S7A10, after the process is checked and killed, modifying the second file node by the display memory leakage monitoring tool.
After the process killing is completed, the process killing module sends the information of the completion of the killing to the display memory leakage monitoring module. And the video memory leakage monitoring tool modifies the value of the second file node into an identifier corresponding to the video memory leakage which does not occur in the process. Illustratively, the second file node uses "1" to indicate that the process has no memory leak; the use of "0" indicates that the process has a memory leak. And when the video memory occupied by the process is larger than the first threshold value, modifying the value of the second file node from '0' to '1', which indicates that the process has no video memory leakage.
In one possible embodiment, see fig. 7B for example. Fig. 7B differs from fig. 7A in that fig. 7B adds the function of uploading logs, including but not limited to the following steps:
and S7B01, applying for video memory from the display driver by the process. For a specific implementation process, please refer to the step S7a01, which will not be described here.
And S7B02, displaying the video memory occupied by the driving monitoring process. For a specific implementation process, please refer to step S7a02, which will not be described herein.
And S7B03, the display driver judges whether the video memory occupied by the current process is larger than a first threshold value. For a specific implementation process, please refer to step S7a03, which is not described here.
And S7B04, the display driver allocates the video memory to the process according to the size of the video memory applied by the process. For a specific implementation process, please refer to step S7a04, which will not be described here.
And S7B05, under the condition that the video memory occupied by the process is larger than the first threshold value, the display driver writes the video memory occupied by the process into the first file node. For a specific implementation process, please refer to step S7a05, which will not be described here.
And S7B06, monitoring the first file node generated by the display driver by the display memory leakage monitoring tool. For a specific implementation process, please refer to step S7a06 described above, which will not be described here.
And S7B07, generating and uploading a log of the video memory occupied by the process by the video memory leakage monitoring tool.
According to a possible implementation mode, the video memory leakage monitoring tool monitors that data recorded by the first file node changes, and a log submodule of the video memory leakage monitoring tool generates a log file according to the data of the first file node and uploads the log file to the cloud server. For a specific implementation process, please refer to step S5C07, which will not be described here.
And S7B08, modifying the second file node by the video memory leakage monitoring tool under the condition that the first file node is changed. For a specific implementation process, please refer to step S7a07, which will not be described here.
And S7B09, the process searching and killing module monitors the second file node. For a specific implementation process, please refer to the above step S7a08, which will not be described here.
And S7B10, a process searching and killing module is used for searching and killing the process. For a specific implementation process, please refer to step S7a09 described above, which will not be described herein.
And S7B11, when the process is checked and killed, modifying the second file node by the display memory leakage monitoring tool. For a specific implementation process, please refer to the step S7a10, which will not be described here.
And S7B12, the process searching and killing module generates and uploads a log of process memory leakage.
In a possible implementation manner, after the process is completely checked and killed in step S7B11, the name, the identification code, the occupied display memory of the process that has been checked and killed, and the display memory available to the system after the completion of checking and killing are sent to the log submodule of the process checking and killing module. And the log submodule generates a log according to the data and uploads the log to the cloud server.
In one possible embodiment, see, for example, fig. 7C. The difference between fig. 7C and fig. 7B is that the method shown in fig. 7C needs to send the process to be killed to the display screen before the process is killed, and the process can be killed after the display screen receives the instruction of the process to be killed, which includes but is not limited to the following steps:
and S7C01, applying for the display memory from the process to the display driver. For a specific implementation process, please refer to the step S7a01, which will not be described here.
And S7C02, displaying the video memory occupied by the driving monitoring process. For a specific implementation process, please refer to step S7a02, which will not be described herein.
And S7C03, the display driver judges whether the video memory occupied by the current process is larger than a first threshold value. For a specific implementation process, please refer to the step S7a03, which will not be described here.
And S7C04, the display driver allocates the video memory to the process according to the size of the video memory applied by the process. For a specific implementation process, please refer to step S7a04, which will not be described here.
And S7C05, under the condition that the video memory occupied by the process is larger than the first threshold value, the display driver writes the video memory occupied by the process into the first file node. For a specific implementation process, please refer to step S7a05, which will not be described here.
And S7C06, monitoring a first file node generated by a display driver by a display memory leakage monitoring tool. For a specific implementation process, please refer to step S7a06 described above, which will not be described here.
And S7C07, generating and uploading a log of the progress occupying the video memory by the video memory leakage monitoring tool. For a specific implementation process, please refer to step S7B07, which will not be described here.
And S7C08, modifying the second file node by the video memory leakage monitoring tool under the condition that the first file node is changed. For a specific implementation process, please refer to step S7a07, which will not be described here.
And S7C09, the process searching and killing module monitors the second file node. For a specific implementation process, please refer to the above step S7a08, which will not be described here.
And S7C10, the process searching and killing module sends first indication information to the display screen.
When the step S7C09 monitors that the process corresponding to the second file node has a memory leak, the process searching and killing module generates first indication information and sends the first indication information to the display screen. As an example, referring to fig. 7D, the display screen renders the first indication information and displays the content of the first indication information on the screen. For example: when the system monitors that the display memory leakage occurs in the process named as 'WeChat', a popup window is generated on a display screen of the electronic equipment, the content of the popup window is 'whether to approve to check and kill a third process', an 'approve' button and a 'cancel' button are attached, and the popup window is used for enabling a user to select whether to check and kill the process named as 'the third process', wherein the 'approve' button indicates that the 'third process' is approved to be checked and killed, and the 'cancel' button indicates that the 'third process' is not approved to be checked and killed. The content of the pop-up window, the specific content of the pop-up window, the position where the pop-up window appears, and the name of the killing process are only given by way of example in the present application without limitation.
And S7C11, the process searching and killing module receives a first instruction returned by the display screen and searches and kills the target process according to the first instruction.
The first instruction is used for indicating a killing object of the process killing module, and the process killing module calls an Activity Manager Service (AMS) to kill the target process according to the indication information of the first instruction.
For a specific implementation process of the checking and killing process, please refer to the step S7a09, which is not described herein.
And S7C12, when the process is finished, modifying the second file node by the video memory leakage monitoring tool. For a specific implementation process, please refer to step S7a10, which will not be described herein.
And S7C13, generating and uploading a log of process memory leakage by the process checking and killing module. For a specific implementation process, please refer to step S7B12, which will not be described herein.
As shown in fig. 7E, an embodiment of monitoring and handling memory leaks is provided. The display driver in the inner core layer firstly sends the monitored display memory abnormal information to the display memory leakage reporting module through the abnormal display memory monitoring module. Then, the video memory leakage reporting module stores the received video memory abnormal information into a video memory leakage report, and stores the video memory leakage report into a/system/kernel layer/video memory state report folder.
The abnormal video memory monitoring module monitors the video memory occupied by the process. Corresponding to step S7B02 displaying the video memory occupied by the driver monitor process.
The video memory exception information corresponds to a case where the video memory value occupied by the process in step S7B05 is greater than the first threshold.
The video memory leakage reporting module stores the received video memory abnormal information into a video memory leakage report, stores the video memory leakage report into a folder of a/system/kernel layer/video memory state report, and equivalently displays the video memory occupied by the process by the driver in the step S7B05 and writes the video memory into the first file node.
As shown in fig. 7E, the display controller in the kernel layer generates a "display memory error node" of the application program through the leakage process state node management module, and stores the node into the "/device/display controller/application program/package name" folder. In step S7B08, in the case where there is no second file node in the kernel layer, the video memory resource controller creates a second file node.
As shown in fig. 7E, the monitor tool for the leakage of the memory in the system library layer monitors the leakage report of the memory, processes data in the leakage report of the memory, forms a leakage log of the memory, and uploads the leakage log to the cloud server. The method is equivalent to the step S7B07 that the video memory leakage monitoring tool generates and uploads the log of the video memory occupied by the process.
As shown in fig. 7E, if the data in the display leak report indicates that the process has a display leak, the display leak monitoring tool in the system library layer sends the information to the leak recovery control sub-module. And after receiving the information, the leakage recovery control module modifies the video memory error node. In step S7B08, when the first file node is changed, the memory leak monitoring tool modifies the second file node.
As shown in fig. 7E, the process searching and killing module in the framework layer monitors the video memory error node in the kernel layer through the scheduling submodule thereof, and searches and kills the corresponding process according to the monitored information. And meanwhile, the monitored information is sent to a log reporting module in the process searching and killing module, the log reporting module generates a log according to the received monitoring information, and the log is uploaded to a cloud server.
In the above, the process checking and killing module in the framework layer monitors the video memory error node in the kernel layer through the scheduling submodule. Equivalently, step S7B09 processes the searching and killing module to monitor the second file node.
And searching and killing the corresponding process according to the monitored information. Equivalently, the S7B10 process searching and killing module searches and kills the process.
The log reporting module generates a log according to the received monitoring information, and then uploads the log to the cloud server. Equivalently, in step S7B12, the process check and kill module generates and uploads the log of the display memory occupied by the process.
In one practical manner, see fig. 7F for example. The function of the memory leak monitoring tool may be implemented at the framework layer for implementing the same function as fig. 7E.
One way of doing this is shown schematically in fig. 7G. In contrast to fig. 7E and 7F, fig. 7G only uses the display driver of the kernel layer and the progress killer module of the frame layer.
When the display driver monitors that the process applies for the video memory, the condition that the process occupies the video memory is monitored, and if the video memory occupied by the process is larger than a first threshold value, the process is identified as the process with video memory leakage in a mode of a video memory error node. And a scheduling submodule of the process searching and killing module in the framework layer monitors the display memory error node and searches and kills the process according to the monitored information. And after the searching and killing are finished, the name, the identification code, the occupied display memory of the searched and killed process and the display memory available to the system after the searching and killing are finished are sent to a log submodule of the process searching and killing module. And the log submodule generates a log according to the data and uploads the log to the cloud server.
In an implementation manner, referring to fig. 8A as an example, a method for a process killing module to kill a process is provided, which includes, but is not limited to the following steps:
and S8A01, starting a process searching and killing module.
According to a possible implementation mode, some logics are set, the process killing module is started under the condition that a specific condition is triggered, and the process killing module enters a dormant state in other time periods, so that the energy consumption of a system is reduced.
The logic for setting some of the above-mentioned logic includes one or more of the following, in the system, a process is running, that is, a process checking and killing module is started, when the remaining display memory of the system is lower than a fourth threshold value, a process checking and killing module is started, that is, a process checking and killing module is started at regular intervals, and a process is started, that is, a process checking and killing module is started.
According to a possible implementation mode, when the process in the system is running, the process searching and killing module is started to monitor the process in the system in real time, and the process is searched and killed under the condition that the process searching and killing condition is met.
In a possible implementation mode, the process killing module is started when the system has the residual video memory with the fourth threshold value. When the system has sufficient video memory, the system performance cannot be influenced by a small amount of video memory leakage, and meanwhile, the user experience is influenced by the checking and killing process, so that the process checking and killing module does not need to be started to check and kill the process for monitoring the video memory leakage. Illustratively, if the residual video memory of the system is lower than 500MB, a process checking and killing module is started to monitor the process in the system in real time, and the process is checked and killed under the condition that the process checking and killing condition is satisfied.
The value range of the fourth threshold is greater than 0 and less than the maximum available video memory of the display memory, and may be one-half of the maximum available video memory, one-fourth of the maximum available video memory, and the like, which is not limited in the present application. The setting of the value of the fourth threshold includes, but is not limited to, the following methods:
the fourth threshold is set through a configuration information item (prop) of the mobile phone, and this method may be set by a mobile phone provider when the mobile phone leaves a factory, and the mobile phone provider may also update the fourth threshold in a system update manner during the use of the mobile phone by the user. It is understood that the setting of the fourth threshold may be modified manually, and different processes may set different fourth thresholds, and after the setting of the fourth threshold is completed, the size of the fourth threshold is not changed with the use of the mobile phone.
In one possible implementation, the process killing module is started at regular intervals. Illustratively, after the process killing module runs for the first time, the process killing module is started every one minute to monitor the process in the system, and the process is killed under the condition that the process killing condition is met. The predetermined time period may be one minute, two minutes, ten minutes, or the like, and the specific value is not limited.
In one possible implementation, the process killing module is started when a certain process is started. When some processes are easy to leak the display memory for many times, the identification codes of the processes are added into a blacklist (the list in which the processes are easy to leak the display memory), and when the process in the blacklist is detected to be running, a process checking and killing module is started to monitor the processes in the blacklist in real time, and the processes are checked and killed when the process checking and killing condition is met.
One or more of the aforementioned conditions for starting the processes may be used simultaneously. In the case where a plurality of trigger conditions are used simultaneously, a priority may be set to each trigger condition. Illustratively, the process checking and killing module is started at regular intervals, the process checking and killing module is started when the residual video memory of the system is lower than a fourth threshold value, and the process checking and killing module is started when a process is started. Illustratively, when the system display memory is lower than 500MB, the process killing module is started for the first time, monitors all processes in the system, and kills the processes when the process killing condition is satisfied. After a round of process searching and killing is completed, the process searching and killing module enters a dormant state, and the process searching and killing module is started every other minute to perform a new round of searching and killing on the process running in the system. And after the processes in the process focus monitoring list appear in the system, the process searching and killing module monitors the processes in the list in real time, and the process searching and killing module is started every minute for the rest of the processes.
S8A02, the process checking and killing module judges whether the second file node represents that the process has the display memory leakage.
After the process checking and killing module is started, whether the data of the second file node corresponding to each process in the system indicates that the process has the video memory leakage or not is judged. Exemplarily, the process killing module determines a second file node of each process in the system, and terminates the killing of the current process by the process killing module when the second file node corresponding to the process indicates that the process has no display memory leakage. And when the second file node corresponding to the process indicates that the process has the video memory leakage, the process killing module executes the next operation.
And S8A03, the process checking and killing module checks and kills the process which has the video memory leakage.
In one possible implementation mode, the process checking and killing module checks and kills the module with the display memory leakage through the thread management server.
In a possible implementation manner, for example, referring to fig. 8B, a method for a process killing module to kill a second process is provided. The method is used for solving the problem that the residual video memory of the system is insufficient, but the video memory leakage of the process does not occur. The second process is any one process in the system under the conditions that the residual video memory of the system is insufficient and video memory leakage does not occur in the process. The method includes, but is not limited to, the steps of:
and S8B01, starting a process searching and killing module.
In a possible implementation mode, some logics are set, when a specific condition is triggered, the process killing module is started, and the process killing module enters a dormant state in other time periods, so that the energy consumption of the system is reduced.
The aforementioned logic includes one or more of the following, in the system, a second process is running, that is, a process checking and killing module is started, when the remaining display memory of the system is lower than a fourth threshold value, the process checking and killing module is started, that is, the process checking and killing module is started at regular intervals, and a certain second process is started, that is, the process checking and killing module is started. The specific implementation process is described in detail in step S8a01, and is not described in excess here.
And S8B02, judging whether the residual available video memory of the system is lower than a second threshold value.
And the display driver acquires the residual available video memory of the system through the video memory management unit and judges whether the residual available video memory of the system is lower than a second threshold value. And when the residual video memory of the system is lower than the second threshold value, the process searching and killing module executes the next operation.
Exemplarily, the second threshold is set to be 500M, whether the remaining available video memory of the system is lower than 500M is determined, and when the remaining video memory of the system is higher than 500M, the process killing module is terminated to kill the current second process. And when the residual video memory of the system is lower than 500M, the process searching and killing module executes the next operation.
And S8B03, the process killing module judges whether the second file node represents that the second process has the display memory leakage or not.
After the process checking and killing module is started, firstly, whether the data of the second file node corresponding to each second process in the system indicates that the second process has the video memory leakage or not is judged. Illustratively, the process killing module determines the second file node of each second process in the system, and terminates the process killing of the process killing module on the current second process when the second file node corresponding to the second process indicates that the second process has no display memory leakage. And when the second file node corresponding to the second process indicates that the second process has the video memory leakage, the process killing module executes the next operation.
And S8B04, the process searching and killing module generates a list of second processes which can be searched and killed.
And the process management server in the framework layer generates a list of the second process which can be checked and killed according to a preset index. The preset indexes comprise one or more of the following indexes, namely the video memory occupied by the second process, the active time length of the second process and the priority of the application program corresponding to the second process.
Illustratively, the process management servers in the framework layer sort according to the size of the display memory occupied by the second process, and the second process occupying the most display memory is located at the top of the list capable of checking and killing and is marked as the checking and killing object of the process checking and killing module.
Illustratively, the process management servers in the framework layer are sorted according to the length of the active time of the second process, and the second process with the longest active time is located at the top of the list of the processes to be killed and is marked as the object to be killed of the process killing module.
Illustratively, the process management servers in the framework layer are sorted according to the size of the occupied display memory, and the second process occupying the most display memory is located at the top of the list capable of being checked and killed. And then, selecting the first ten second processes of the list, and sequencing according to the active time of the second processes, wherein the second process with the longest active time is positioned at the top of the list capable of checking and killing and is marked as a checking and killing object of the process checking and killing module.
And S8B05, the process searching and killing module searches and kills the second process. For the process searching and killing process of the second process by the process searching and killing module, please refer to the process searching and killing process shown in step S8a03, which is not described in detail herein. The difference between step S8B05 and step S8a03 is that, after the process killing operation is performed in step S8a03, the process killing operation for the current process is completed, and the process killing module may perform the killing operation for other processes. After the process killing operation is executed in step S8B05, step S8B02 is continuously executed, and only when step S8B02 determines that the remaining video memory of the system is greater than the second threshold, one killing operation is ended.
In a possible implementation manner, for example, referring to fig. 8C, a method for a process killing module to kill a second process is provided. The method is different from the method shown in fig. 8B in that after the list of the second processes which can be killed and examined is generated, the method further comprises the steps of sending second indication information to the display screen and receiving a second instruction of the display screen. The method includes, but is not limited to, the steps of:
and S8C01, starting a process searching and killing module. For a specific implementation process, please refer to the step S8B01, which will not be described here.
And S8C02, judging whether the residual available video memory of the system is lower than a second threshold value. For a specific implementation process, please refer to the step S8B02, which will not be described here.
And S8C03, the process checking and killing module judges whether the second file node represents that the second process has the display memory leakage. For a specific implementation process, please refer to step S8B03, which is not described herein.
And S8C04, the process searching and killing module generates a list of second processes which can be searched and killed. For a specific implementation process, please refer to step S8B04, which will not be described here.
And S8C05, the process searching and killing module sends second indication information to the display screen.
And the process searching and killing module generates second indication information and sends the second indication information to the display screen, and the display screen renders the second indication information and displays the content of the second indication information on the screen. As an example, referring to fig. 8D, the display screen renders the aforementioned second indication information and displays the content of the second indication information on the screen.
For example: when step S8C04 generates a list of available processes, it indicates that the three processes "fourth process", "fifth process", and "sixth process" can be available for killing. The display screen of the electronic equipment can generate a popup window, the content of the popup window is ' the display memory is insufficient, the process which can be checked and killed is selected, the display memory is cleaned, and a ' fourth process ' button, a ' fifth process ' button, a ' sixth process ' button, an ' agreement ' button and a ' cancel ' button are attached. When the circles at the upper left corners of the "fourth progress" button, the "fifth progress" button and the "sixth progress" button are empty, the corresponding "fourth progress" progress, the "fifth progress" progress and the "sixth progress" progress are not selected.
For example, referring to fig. 8E, it can be seen from fig. 8E that the circles at the upper left corners of the "fourth progress" button and the "fifth progress" button are filled with color to indicate that the corresponding "fourth progress" and "fifth progress" have been selected. Further clicking the "agree" button indicates agreement to kill any one of the "fourth process" and the "fifth process", and the "cancel" button indicates disagreement to kill any one of the "fourth process", the "fifth process", and the "sixth process".
The "cancel" button may be clicked directly without selecting any one of the process buttons for indicating that it is not agreed to kill any one of the "fourth process", "fifth process", and "sixth process".
The "agree" button may not be clicked directly without selecting any of the progress buttons.
The pop-up window can specify a plurality of processes to be checked and killed, so that a user can select the processes, and the application is not limited by the number of the given processes.
More processes which can be selected can be checked in a popup window in a clicking or sliding mode. The aforementioned sliding may be up and down sliding, left and right sliding, etc., and the present application exemplarily gives a click manner, as shown in fig. 8F. The content of the popup is used for indicating one or more of the fourth process, the fifth process or the sixth process to be killed, and the content of the popup can be used for indicating one or more of the seventh process, the eighth process or the ninth process to be killed by clicking a 'more processes' button.
The content of the pop-up window is given only by way of example, and the application is not limited with respect to the specific content of the pop-up window, the position where the pop-up window appears and the name of the killing process.
And S8C06, the process searching and killing module receives a second instruction returned by the display screen and searches and kills the target process according to the second instruction.
The second instruction is used for indicating a killing object of the process killing module, the second instruction comprises one or more processes to be killed, and the specific number of the processes is not limited in the application. And the process searching and killing module calls the thread management server to search and kill the target process according to the indication information of the second instruction.
For a specific implementation process of the checking and killing process, please refer to the step S7a09, which is not described herein.
And S8C07, the process searching and killing module searches and kills the second process. For a specific implementation process, please refer to step S8B05, which will not be described here.
FIG. 8G provides a specific embodiment of a process kill module kill process. The process checking and killing module is started once every one minute, and after the process checking and killing module is started, whether the video memory leakage node corresponding to the process is 1 or not is judged. If the video memory leakage node is not 1, the process is not subjected to video memory leakage, and the process killing is finished. If the video memory leakage node is 1, the video memory leakage of the process is shown, and then whether the residual available video memory of the GPU memory is less than 200MB or not is judged. If the GPU residual video memory is larger than 200MB, the residual video memory is sufficient, and even if the video memory leakage occurs in the process, the experience of the user using the electronic equipment is not influenced. And if the residual video memory is less than 200MB, further judging the video memory occupied by the process. If the video memory occupied by the process is less than 2GB, the process is considered to have no video memory leakage, and the process killing is finished. If the video memory occupied by the process is larger than 2GB, the process is considered to have video memory leakage, and the process killing module calls the thread management server to kill the process.
Exemplarily, refer to fig. 8H. The method for processing the video memory leakage provided by the embodiment of the application comprises the following steps of:
and S8H01, acquiring information of a first process, wherein the first process is a process applying for video memory, and the information of the first process indicates the video memory occupied by the first process.
The first process may be, for example, the process in fig. 4A that applies for a video memory to the display driver, and the video memory occupied by the first process may be, for example, the video memory occupied by the process monitored and acquired by the display driver in fig. 4A.
And S8H02, checking and killing the first process under the condition that the video memory occupied by the first process is larger than a first threshold value.
The first threshold may be the first threshold set in step S4a05 by the configuration information item (prop) of the mobile phone. The first process may be the process killing module in fig. 6A, and the process is killed.
In a possible implementation manner, the killing the first process includes: and sending first indication information to a display screen of the electronic equipment, wherein the first indication information is used for indicating whether to check and kill the first process, and the electronic equipment is used for operating the first process. And acquiring a first instruction for killing the first process through the display screen. And killing the first process based on the first instruction.
The display screen may be the display screen of the electronic device in fig. 7C, and the first indication information may be the first indication information sent by the process killing module in fig. 7C to the display screen. The electronic device may be the electronic device shown in fig. 1 described above.
In a possible implementation manner, the first process runs in an electronic device, and the method further includes:
determining a second process in the electronic equipment under the condition that the video memory occupied by the first process is smaller than the first threshold and the residual available video memory of the system is smaller than a third threshold; the second process is an inactive process or a process occupying most video memory in the electronic equipment; and checking and killing the second process.
The third threshold may be the second threshold in fig. 8C, and the second process may be one of the processes in the checkable process list in fig. 8C.
In a possible implementation manner, the second process is a process with the lowest activity level among a plurality of inactive processes in the electronic device.
This process may be the first process in the list of searchable processes described above in fig. 8C.
In one possible implementation, the killing the second process includes: and sending second indication information to a display screen of the electronic device, wherein the second indication information is used for indicating whether to check and kill the second process, and the electronic device is used for operating the second process. Acquiring a second instruction for searching and killing the second process through the display screen; and killing the second process based on the second instruction.
The second indication information may be the second indication information sent to the display screen in fig. 8C described above.
The second instruction may be the second instruction of the receiving display screen in fig. 8C.
In a possible embodiment, the method further comprises: and sending the information of the first process to a cloud server.
The cloud server may be the cloud server side in fig. 7E.
The foregoing mainly introduces a method for processing video memory leakage provided in this embodiment. It is understood that each device comprises corresponding hardware structures and/or software modules for executing each function in order to realize the corresponding function. The present application can be realized in hardware or a combination of hardware and computer software, in conjunction with the exemplary elements and steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the device may be divided into the functional modules according to the method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and when the actual implementation is performed, another division manner may be provided.
In the case of dividing each functional module according to each function, fig. 9 shows a schematic diagram of a possible logical structure of the apparatus, which may be the above-mentioned memory leakage processing apparatus. The apparatus 900 includes a first obtaining unit 901, a second obtaining unit 902, and a killing unit 903. Wherein:
a first obtaining unit 901, configured to obtain the first threshold from the cloud server.
A second obtaining unit 902, configured to obtain information of a process, where the process is a process applying for video memory, and the information of the process includes video memory occupied by the process;
a checking and killing unit 903, configured to check and kill the process when the video memory occupied by the process is greater than the first threshold.
In a possible implementation manner, the case that the video memory occupied by the process is greater than the first threshold includes: the process has the condition of memory leak.
In a possible implementation manner, the searching and killing unit 903 is specifically configured to: and under the condition that the video memory occupied by the process is larger than a first threshold value and the residual available video memory of the system is smaller than a second threshold value, the process is killed.
In a possible implementation manner, the searching and killing unit 903 is specifically configured to:
under the condition that the video memory occupied by the process is larger than a first threshold value, sending first indication information to a display screen of electronic equipment, wherein the first indication information is used for indicating whether to check and kill the process, and the electronic equipment is used for operating the process; acquiring a first instruction for searching and killing the process through the display screen; and killing the process based on the first instruction.
In a possible implementation manner, the searching and killing unit 903 is specifically configured to:
determining a second process in the electronic equipment under the condition that the video memory occupied by the process is smaller than the first threshold and the residual available video memory of the system is smaller than a third threshold; the second process is an inactive process or a process occupying the most video memory in the electronic equipment; and killing the second process.
In a possible implementation manner, the searching and killing unit 903 is specifically configured to:
determining a second process in the electronic equipment under the condition that the video memory occupied by the process is smaller than the first threshold and the residual available video memory of the system is smaller than a third threshold; the second process is a process with the lowest activity among a plurality of inactive processes in the electronic device. And killing the second process.
In a possible implementation manner, the searching and killing unit 903 is specifically configured to:
sending second indication information to a display screen of the electronic device, wherein the second indication information is used for indicating whether to check and kill the second process, and the electronic device is used for operating the second process; acquiring a second instruction for searching and killing the second process through the display screen; and checking and killing the second process according to the second instruction.
In a possible embodiment, the aforementioned apparatus further comprises: and the sending unit is used for sending the information of the process to the cloud server.
Fig. 10 is a schematic diagram illustrating a possible hardware structure of the apparatus provided in the present application, where the apparatus may be a vehicle or a vehicle-mounted control system of the vehicle in the method according to the foregoing embodiment. The apparatus 1000 comprises: a processor 1001, a memory 1002, and a communication interface 1003. The processor 1001, the communication interface 1003, and the memory 1002 may be connected to each other or connected to each other through a bus 1004.
Illustratively, the memory 1002 is used for storing computer programs and data of the apparatus 1000, and the memory 1002 may include, but is not limited to, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or portable read-only memory (CD-ROM), etc.
Software or program codes required by the functions of all or part of the units of the video memory leakage processing method and the related device in the above method embodiments are stored in the memory 1002.
In a possible implementation, if software or program codes required for functions of a part of the units are stored in the memory 1002, the processor 1001 may cooperate with other components (such as the communication interface 1003) to perform other functions (such as functions of receiving or sending data) described in the method embodiments, besides calling the program codes in the memory 1002 to realize the part of the functions.
The number of the communication interfaces 1003 may be multiple, and are used for supporting the apparatus 1000 to perform communication, such as receiving or sending data or signals.
The processor 1001 may illustratively be a central processing unit, a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, transistor logic, a hardware component, or any combination thereof. A processor may also be a combination of computing functions, e.g., a combination of one or more microprocessors, a digital signal processor and a microprocessor, or the like. The processor 1001 may be configured to read the program stored in the memory 1002 and execute the method described in fig. 4A or fig. 5A and possible embodiments thereof.
Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and the computer program is executed by a processor to implement operations performed by the electronic device according to any one of the foregoing embodiments and possible embodiments thereof.
The embodiments of the present application also provide a computer program product, when the computer program product is read and executed by a computer, the operations performed by the electronic device of any one of the above embodiments and possible embodiments thereof are performed.
In conclusion, according to the scheme, the process which occupies too high display memory is checked and killed by acquiring the display memory occupied by the process, so that the problems of system blockage, screen freezing of a mobile phone and the like caused by display memory leakage are solved, and the user experience is improved.
The terms "first," "second," and the like in this application are used for distinguishing between similar items and items that have substantially the same function or similar functionality, and it should be understood that "first," "second," and "nth" do not have any logical or temporal dependency or limitation on the number or order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another.
It should also be understood that, in the embodiments of the present application, the size of the serial number of each process does not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It will be further understood that the terms "comprises," "comprising," "includes," and/or "including," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be appreciated that reference throughout this specification to "one embodiment," "an embodiment," "one possible implementation" means that a particular feature, structure, or characteristic described in connection with the embodiment or implementation is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" or "one possible implementation" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (21)

1. A method for processing video memory leakage is characterized by comprising the following steps:
acquiring information of a first process, wherein the first process is a process applying for video memory, and the information of the first process indicates the video memory occupied by the first process;
and under the condition that the video memory occupied by the first process is larger than a first threshold value, checking and killing the first process.
2. The method of claim 1, wherein the case that the video memory occupied by the first process is greater than a first threshold comprises: and the first process has the condition of display memory leakage.
3. The method according to claim 1 or 2, wherein, in the case that the video memory occupied by the first process is greater than a first threshold, killing the first process comprises:
and under the condition that the video memory occupied by the first process is greater than a first threshold value and the remaining available video memory of the system is less than a second threshold value, killing the first process.
4. The method of claim 1 or 2, wherein the killing the first process comprises:
sending first indication information to a display screen of electronic equipment, wherein the first indication information is used for indicating whether to check and kill the first process, and the electronic equipment is used for operating the first process;
acquiring a first instruction for searching and killing the first process through the display screen;
killing the first process based on the first instruction.
5. The method of claim 1 or 2, wherein the first process runs in an electronic device, the method further comprising:
determining a second process in the electronic equipment under the condition that the video memory occupied by the first process is smaller than the first threshold and the remaining available video memory of the system is smaller than a third threshold; the second process is an inactive process or a process occupying most video memory in the electronic equipment;
and checking and killing the second process.
6. The method of claim 5, wherein the second process is a least active process of a plurality of inactive processes in the electronic device.
7. The method of claim 5, wherein the killing the second process comprises:
sending second indication information to a display screen of the electronic device, wherein the second indication information is used for indicating whether to check and kill the second process, and the electronic device is an electronic device for operating the second process;
acquiring a second instruction for searching and killing the second process through the display screen;
killing the second process based on the second instruction.
8. The method according to claim 1 or 2, characterized in that the method further comprises:
and sending the information of the first process to a cloud server.
9. The method of claim 1 or 2, wherein the first threshold is from a cloud server.
10. A device for handling memory leaks, the device comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring information of a first process, the first process is a process applying for video memory, and the information of the first process indicates the video memory occupied by the first process;
and the checking and killing unit is used for checking and killing the first process under the condition that the video memory occupied by the first process is greater than a first threshold value.
11. The apparatus of claim 10, wherein the case that the video memory occupied by the first process is greater than a first threshold value comprises: and the first process has the condition of video memory leakage.
12. The device according to claim 10 or 11, wherein the killing unit is specifically configured to:
and under the condition that the display memory occupied by the first process is larger than a first threshold value and the remaining available display memory of the system is smaller than a second threshold value, the first process is killed.
13. The device according to claim 10 or 11, wherein the killing unit is specifically configured to:
sending first indication information to a display screen of electronic equipment under the condition that the video memory occupied by the first process is larger than a first threshold, wherein the first indication information is used for indicating whether to check and kill the first process, and the electronic equipment is used for operating the first process;
acquiring a first instruction for searching and killing the first process through the display screen;
killing the first process based on the first instruction.
14. The apparatus according to claim 10 or 11, wherein the first process is executed in an electronic device, and the checking and killing unit is specifically configured to:
determining a second process in the electronic equipment under the condition that the video memory occupied by the first process is smaller than the first threshold and the residual available video memory of the system is smaller than a third threshold; the second process is an inactive process or a process occupying most video memory in the electronic equipment;
and checking and killing the second process.
15. The device according to claim 14, wherein the killing unit is specifically configured to:
determining a second process in the electronic equipment under the condition that the video memory occupied by the first process is smaller than the first threshold and the remaining available video memory of the system is smaller than a third threshold; the second process is a process with the lowest activity level in a plurality of inactive processes in the electronic equipment;
and checking and killing the second process.
16. The device according to claim 14, wherein the killing unit is specifically configured to:
sending second indication information to a display screen of the electronic device, wherein the second indication information is used for indicating whether to check and kill the second process, and the electronic device is an electronic device for operating the second process;
acquiring a second instruction for searching and killing the second process through the display screen;
killing the second process based on the second instruction.
17. The apparatus according to claim 10 or 11, further comprising:
and the sending unit is used for sending the information of the first process to a cloud server.
18. The apparatus of claim 10 or 11, further comprising:
a first obtaining unit, configured to obtain the first threshold from a cloud server.
19. An apparatus for handling memory leaks, the apparatus comprising a processor and a memory, wherein the memory is configured to store a computer program, and the processor is configured to execute the computer program stored in the memory, so that the apparatus performs the method according to claim 1 or 2.
20. An electronic device, characterized in that the electronic device comprises a processing device, wherein the processing device is the processing device for video memory leakage according to claim 10 or 11.
21. A computer-readable storage medium, in which a computer program is stored, which computer program is executable by a processor to implement the method of claim 1 or 2.
CN202211154738.4A 2022-09-22 2022-09-22 Video memory leakage processing method and related device Active CN115292199B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211154738.4A CN115292199B (en) 2022-09-22 2022-09-22 Video memory leakage processing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211154738.4A CN115292199B (en) 2022-09-22 2022-09-22 Video memory leakage processing method and related device

Publications (2)

Publication Number Publication Date
CN115292199A true CN115292199A (en) 2022-11-04
CN115292199B CN115292199B (en) 2023-03-24

Family

ID=83833724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211154738.4A Active CN115292199B (en) 2022-09-22 2022-09-22 Video memory leakage processing method and related device

Country Status (1)

Country Link
CN (1) CN115292199B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115794476A (en) * 2023-02-01 2023-03-14 荣耀终端有限公司 Processing method of kernel graphic system layer memory and terminal equipment
CN117112193A (en) * 2023-04-10 2023-11-24 荣耀终端有限公司 Memory resource management method and electronic equipment

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8060700B1 (en) * 2008-12-08 2011-11-15 Nvidia Corporation System, method and frame buffer logic for evicting dirty data from a cache using counters and data types
CN104731721A (en) * 2015-02-10 2015-06-24 深圳酷派技术有限公司 Sharing method and device for memory for display
CN105824631A (en) * 2016-03-16 2016-08-03 深圳市金立通信设备有限公司 Control method of application program and terminal
CN106502793A (en) * 2016-10-21 2017-03-15 搜游网络科技(北京)有限公司 A kind of concocting method of game resource and equipment
CN109144714A (en) * 2017-06-19 2019-01-04 中兴通讯股份有限公司 EMS memory management process and device
CN110457135A (en) * 2019-08-09 2019-11-15 重庆紫光华山智安科技有限公司 A kind of method of resource regulating method, device and shared GPU video memory
CN110930291A (en) * 2019-11-15 2020-03-27 山东英信计算机技术有限公司 GPU video memory management control method and related device
CN113467958A (en) * 2021-09-02 2021-10-01 腾讯科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium
CN113835887A (en) * 2021-09-17 2021-12-24 北京百度网讯科技有限公司 Video memory allocation method and device, electronic equipment and readable storage medium
WO2022078105A1 (en) * 2020-10-12 2022-04-21 华为技术有限公司 Memory management method, electronic device, and computer-readable storage medium
CN114443263A (en) * 2020-11-03 2022-05-06 阿里巴巴集团控股有限公司 Video memory management method, device, equipment and system
CN114490094A (en) * 2022-04-18 2022-05-13 北京麟卓信息科技有限公司 GPU (graphics processing Unit) video memory allocation method and system based on machine learning
CN114579319A (en) * 2022-05-07 2022-06-03 北京象帝先计算技术有限公司 Video memory management method, video memory management module, SOC and electronic equipment

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8060700B1 (en) * 2008-12-08 2011-11-15 Nvidia Corporation System, method and frame buffer logic for evicting dirty data from a cache using counters and data types
CN104731721A (en) * 2015-02-10 2015-06-24 深圳酷派技术有限公司 Sharing method and device for memory for display
CN105824631A (en) * 2016-03-16 2016-08-03 深圳市金立通信设备有限公司 Control method of application program and terminal
CN106502793A (en) * 2016-10-21 2017-03-15 搜游网络科技(北京)有限公司 A kind of concocting method of game resource and equipment
CN109144714A (en) * 2017-06-19 2019-01-04 中兴通讯股份有限公司 EMS memory management process and device
CN110457135A (en) * 2019-08-09 2019-11-15 重庆紫光华山智安科技有限公司 A kind of method of resource regulating method, device and shared GPU video memory
CN110930291A (en) * 2019-11-15 2020-03-27 山东英信计算机技术有限公司 GPU video memory management control method and related device
WO2022078105A1 (en) * 2020-10-12 2022-04-21 华为技术有限公司 Memory management method, electronic device, and computer-readable storage medium
CN114443263A (en) * 2020-11-03 2022-05-06 阿里巴巴集团控股有限公司 Video memory management method, device, equipment and system
CN113467958A (en) * 2021-09-02 2021-10-01 腾讯科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium
CN113835887A (en) * 2021-09-17 2021-12-24 北京百度网讯科技有限公司 Video memory allocation method and device, electronic equipment and readable storage medium
CN114490094A (en) * 2022-04-18 2022-05-13 北京麟卓信息科技有限公司 GPU (graphics processing Unit) video memory allocation method and system based on machine learning
CN114579319A (en) * 2022-05-07 2022-06-03 北京象帝先计算技术有限公司 Video memory management method, video memory management module, SOC and electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JAE-HONAH等: ""L-Bench: An Android benchmark set for low-power mobile GPUs"", 《COMPUTERS & GRAPHICS》 *
张彦卓: ""网络视讯系统开发及其在企业中的应用"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
林健 等: ""深度学习云服务适配问题研究"", 《软件导刊》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115794476A (en) * 2023-02-01 2023-03-14 荣耀终端有限公司 Processing method of kernel graphic system layer memory and terminal equipment
CN117112193A (en) * 2023-04-10 2023-11-24 荣耀终端有限公司 Memory resource management method and electronic equipment

Also Published As

Publication number Publication date
CN115292199B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
CN115292199B (en) Video memory leakage processing method and related device
US20150160976A1 (en) Multitasking method and electronic device therefor
CN114020652B (en) Application program management method and electronic equipment
WO2022078105A1 (en) Memory management method, electronic device, and computer-readable storage medium
WO2022052897A1 (en) Method and device for adjusting memory configuration parameter
CN111381996B (en) Memory exception handling method and device
CN117130824A (en) Method for processing exception, electronic equipment and storage medium
WO2021238376A1 (en) Function pack loading method and apparatus, and server and electronic device
WO2020147859A1 (en) Decentralized fat lock deflation
CN112783418B (en) Method for storing application program data and mobile terminal
EP3819763B1 (en) Electronic device and operating method thereof
WO2023185684A1 (en) Process killing method for application, and electronic device
CN116700813B (en) Method for loading widget, electronic device and readable storage medium
CN116643778B (en) Application program optimization method and electronic equipment
WO2023202406A1 (en) Display method and electronic device
CN115016921B (en) Resource scheduling method, device and storage medium
CN115291995B (en) Message display method, related electronic equipment and readable storage medium
CN116055443B (en) Method for identifying social scene, electronic equipment and computer readable storage medium
CN113535252A (en) Application program running method, related equipment and medium
CN117668846A (en) Hot patching method and related device
CN117707718A (en) Process management method, electronic device and readable storage medium
CN116661584B (en) Resource scheduling method and related equipment
CN116680133A (en) Black screen detection method and electronic equipment
CN115328556A (en) Terminal jamming recovery method and related equipment
CN117131497A (en) Software detection method and electronic equipment

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