Memory management method and device, electronic equipment and storage medium
Obtain the memory overflow threshold of the mobile device through timed incremental memory, divide the memory pressure level, and adjust the memory according to page changes, which solves the problem of different memory management standards of different mobile devices and achieves accurate management and normal operation of device memory.
Patent Information
- Application Number
- CN202411393534.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-24
AI Technical Summary
Different mobile devices have different memory sizes and memory cleaning logic, making it difficult to form a unified memory management standard.
Obtain the memory overflow threshold of mobile devices by regularly incrementing memory, classify memory pressure levels, monitor page changes, and perform memory adjustments based on memory pressure levels and page changes.
It enables accurate acquisition of memory overflow thresholds on different mobile devices, classification of memory pressure levels, and effective memory management to ensure the normal operation of the device.
Smart Images

Figure CN119356859A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer memory management, and more specifically, to a memory management method, device, electronic device and storage medium. Background Art
[0002] Nowadays, with the continuous improvement of people's lives, mobile devices have gradually become the most important computer electronic devices in people's lives. However, there are more and more mobile device brands on the market. The production standards and terminal systems of different manufacturers are different. Even the production standards and terminal systems of different models of mobile devices of the same manufacturer are different, resulting in different memory sizes on different mobile devices and different memory cleaning logics of different mobile devices, which makes it difficult to form a standard for handling memory problems. Summary of the invention
[0003] The present invention aims to overcome at least one defect of the above-mentioned prior art and provides a memory management method, device, electronic device and storage medium, which are used to provide a memory management method suitable for different mobile devices.
[0004] According to one aspect of the present application, a memory management method is provided, the management method comprising:
[0005] Obtain the memory overflow threshold of the mobile device by increasing the memory at a fixed time.
[0006] Dividing the memory pressure level of the mobile device according to the memory overflow threshold;
[0007] Monitoring page changes of the mobile device, and processing the changed pages according to the page changes;
[0008] Get the memory status after the page changes;
[0009] The current memory pressure level is obtained according to the memory condition after the page change, and memory adjustment is performed according to the current memory pressure level and the processed changed page.
[0010] Optionally, the acquiring of the memory overflow threshold of the mobile device by means of periodic memory increment specifically includes:
[0011] Applying for a preset memory size from the mobile device at regular intervals;
[0012] When the mobile device triggers a memory overflow, recording the total memory size currently used by the mobile device;
[0013] The total memory size when several memory overflows occur is obtained, and the memory overflow threshold is obtained according to the total memory size when several memory overflows occur.
[0014] Optionally, dividing the memory pressure level of the mobile device according to the memory overflow threshold specifically includes:
[0015] Dividing the memory overflow threshold into a plurality of memory intervals according to a preset ratio;
[0016] The memory pressure level is allocated to the memory interval according to the maximum memory value of the memory interval and the divided memory interval situation.
[0017] Optionally, the page change includes at least: the page changes from a visible state to an invisible state, and the page changes from an invisible state to a visible state.
[0018] Optionally, monitoring the page change of the mobile device and processing the changed page according to the page change specifically includes:
[0019] Monitoring a scene change notification of the mobile device, and acquiring a context of the scene change according to the scene change notification;
[0020] Extracting the changed page according to the context of the transition change;
[0021] If the page changes from a visible state to an invisible state, the corresponding changed page is added to a preset clearing area;
[0022] If the page changes from an invisible state to a visible state, the corresponding changed page is removed from the preset clearing area; it is determined whether the acquired changed page has been cleared, and if so, the changed page is restored.
[0023] Optionally, the preset clearing area removes a page from the clearing area and performs memory clearing at every preset clearing time in the order of entering the clearing area from the earliest to the latest.
[0024] Optionally, the performing memory adjustment according to the current memory pressure level and the processed changed page specifically includes:
[0025] According to a preset memory adjustment strategy, the resources of the currently displayed page are released, the pages in the clearing area are removed, and the memory of the cleared pages is cleared;
[0026] The memory adjustment strategy includes: if the current memory pressure level is higher, the operation of releasing the resources of the currently displayed page is performed first.
[0027] According to a second aspect of the present application, a memory management device is provided, the management device comprising:
[0028] A threshold acquisition module is used to obtain the memory overflow threshold of the mobile device by means of timed memory increment;
[0029] A level classification module, used to classify the memory pressure level of the mobile device according to the memory overflow threshold;
[0030] A monitoring and processing module, used to monitor page changes of the mobile device and process the changed pages according to the page changes;
[0031] Memory recording module, used to obtain memory status after page changes;
[0032] The memory adjustment module is used to obtain the current memory pressure level according to the memory situation after the page changes, and to perform memory adjustment according to the current memory pressure level and the processed changed page.
[0033] According to a third aspect of the present application, an electronic device is provided, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement a memory management method described in the first aspect above.
[0034] According to a fourth aspect of the present application, a computer storage medium is provided, on which a computer executable program is stored. When the computer executable program is executed, the memory management method described in the first aspect is implemented.
[0035] According to any one of the aspects provided above, a memory management method, device, electronic device and storage medium provided in this embodiment continuously probe and obtain the memory overflow threshold of the corresponding mobile device by adopting a timed incremental memory method. The memory overflow threshold of the mobile device can be more accurately obtained in different mobile devices, and the memory pressure level of the corresponding mobile device can be better divided according to the memory overflow threshold. The page changes of the mobile device can be monitored to determine the current memory pressure level of the mobile device, and the memory of the mobile device can be adjusted more accurately, so that memory management can be accurately achieved in different mobile devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 A schematic diagram of an application scenario of the management method provided in this embodiment.
[0038] Figure 2 This is a flowchart of the steps of the management method provided in this embodiment.
[0039] Figure 3 This is a device structure diagram of the management device provided in this embodiment.
[0040] Figure 4 This is a device structure diagram of the electronic device provided in this embodiment.
[0041] Figure numerals: server 100, terminal 200, threshold acquisition module 11, level classification module 12, monitoring processing module 13, memory recording module 14, memory adjustment module 15, memory 21, processor 22, bus 23, communication interface 24. DETAILED DESCRIPTION
[0042] The drawings of this application are only used for illustrative purposes and should not be construed as limiting the present application. In order to better illustrate the following embodiments, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; it is understandable to those skilled in the art that some well-known structures and their descriptions in the drawings may be omitted.
[0043] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0045] Nowadays, with the continuous improvement of people's lives, mobile devices have gradually become the most important computer electronic devices in people's lives. Almost everyone has personal mobile devices, such as mobile phones, tablets and smart watches. However, there are more and more brand manufacturers of various mobile devices on the market. The production standards and terminal systems of different manufacturers are different. Even the production standards and terminal systems of different models of mobile devices of the same manufacturer are different. This leads to different memory sizes of different mobile devices. Mobile devices with different memory sizes need to set memory management strategies accordingly according to the memory size of the mobile device.
[0046] At the same time, mobile devices with the same memory size, if manufactured by different manufacturers, will be equipped with different operating systems. The operating system will also occupy memory during operation, so the actual memory size occupied by different operating systems during operation is also different; in addition, the specific memory management strategies will also be different in different operating systems, and ultimately it is difficult to form a unified and effective memory management standard.
[0047] This embodiment provides a technical solution that can solve the above-mentioned problem. The specific implementation methods of this application are described in detail below in conjunction with the accompanying drawings.
[0048] For example, a schematic diagram of an application scenario of a memory management method provided in an embodiment of the present application is provided. Figure 1 As shown, the application scenario includes at least a server 100 and a terminal 200 that can communicate with the server 100. The server 100 has an image processing function and can also have a data transmission function for video streams and audio streams; the terminal 200 has a streaming media playback function and can also have an image processing function.
[0049] It is understandable that the server 100 can be an independent electronic device or a cluster of multiple electronic devices; the terminal 200 can be a smart phone terminal, a personal computer, a tablet computer, a car terminal, etc., but is not limited thereto.
[0050] In one practicable manner, the server 100 and the terminal 200 may respectively execute a memory management method provided in an embodiment of the present application, or, optionally, the memory management method provided in an embodiment of the present application is partially executed in the server 100 and partially executed in the terminal 200.
[0051] like Figure 2 As shown, this embodiment provides a memory management method, and the management method includes:
[0052] S1: Obtain the memory overflow threshold of the mobile device by regularly increasing the memory;
[0053] Since different mobile devices have different corresponding memory overflow thresholds, and in the actual operation process, the memory overflow threshold will be affected by different factors, such as temperature, the actual running process, etc., resulting in a certain fluctuation or change in the memory overflow threshold. If the memory overflow threshold is only queried by the system of the mobile device, the obtained memory overflow threshold is inaccurate, so it is necessary to perform actual measurements on different mobile devices. Therefore, in this embodiment, the memory overflow threshold of the mobile device is obtained by means of timed incremental memory, which may specifically include:
[0054] Applying for a preset memory size from the mobile device at regular intervals;
[0055] When the mobile device triggers a memory overflow, recording the total memory size currently used by the mobile device;
[0056] The total memory size when several memory overflows occur is obtained, and the memory overflow threshold is obtained according to the total memory size when several memory overflows occur.
[0057] In a specific implementation, a timer may be set in the APP (Application) of the mobile device, and 1MB (Megabit) of memory may be requested from the system of the mobile device every 0.01s through the timer, and then the memory currently used by the mobile device may be printed out through a log and recorded; by means of timed incremental memory, the used memory of the mobile device may be continuously increased, and eventually the mobile device may trigger a memory overflow. When the memory overflow is triggered, the total memory size used by the mobile device when the memory overflow is currently triggered may be recorded;
[0058] Among them, taking into account that the mobile device is affected by temperature and current system process occupancy under different circumstances, the total memory size when its memory overflows will have a certain deviation, so it is necessary to use the method of timed incremental memory multiple times to collect several total memory sizes, and calculate the average value of the total memory sizes collected and recorded, and use the average value as the memory overflow threshold. By collecting and calculating the average value multiple times, the memory overflow threshold can be obtained more accurately.
[0059] S2: dividing the memory pressure level of the mobile device according to the memory overflow threshold;
[0060] Dividing the memory pressure level according to the memory overflow threshold can better implement memory release strategies according to different memory pressure levels. Usually, the memory pressure level is divided from high to low, and a memory interval corresponds to each memory pressure level. According to the memory interval where the used memory of the mobile device is located, the current memory pressure level of the mobile device can be obtained. In this embodiment, the memory pressure level of the mobile device is divided according to the memory overflow threshold, specifically including:
[0061] Dividing the memory overflow threshold into a plurality of memory intervals according to a preset ratio;
[0062] The memory pressure level is allocated to the memory interval according to the maximum memory value of the memory interval and the divided memory interval situation.
[0063] It is understandable that the higher the memory pressure level is, the closer the used memory size is to the memory overflow threshold, and the current page of the mobile device is at risk of flashing back at any time. Therefore, in the actual application process, appropriately relaxing the memory interval corresponding to the high-level memory pressure level can avoid memory overflow as much as possible and ensure the normal operation of the mobile device.
[0064] S3: monitoring page changes of the mobile device, and processing the changed pages according to the page changes;
[0065] In this embodiment, the page changes at least include: the page changes from a visible state to an invisible state, and the page changes from an invisible state to a visible state; wherein, the page changes from a visible state to an invisible state, usually indicates that the current page of the mobile device changes from the front end to the back end through a transition, and correspondingly, the page changes from an invisible state to a visible state, usually indicates that the page of the back end of the mobile device changes from the back end to the front end display through a transition.
[0066] The monitoring of the page change of the mobile device and processing the changed page according to the page change may specifically include:
[0067] Monitoring a scene change notification of the mobile device, and acquiring a context of the scene change according to the scene change notification;
[0068] Specifically, the transition methods of the mobile device usually include two types. One is to add the corresponding page to the display queue or stack by push or pop method to directly realize the transition between different pages. The other is to realize the transition switching between different pages through tab. In the actual application process of this embodiment, a page tracker can be constructed in the mobile device. The page tracker is based on the specific implementation class component of the transition method of the mobile device. The page tracker obtains the entity of the currently displayed page and registers the transition notification. When the page tracker receives the transition notification, it updates the currently displayed page entity according to the transition method and obtains the context of the changed page.
[0069] For example, taking the IOS system as an example, the page switching method in the IOS system mainly includes:
[0070] UINavigationController and UITabBarController, among which UINavigationController is mainly used to transition the current page to another page through push or pop, while UITabBarController is mainly used to switch between different pages through tabs;
[0071] There is a topViewController property in UINavigationController. Generally, it represents the currently visible page controller (viewController). In the proxy method of UINavigationController, you can get the latest displayed page controller. Since UINavigationController does not provide push or pop context, the PushViewController and PopViewController methods in UINavigationController are rewritten to obtain the transition context and throw the transition context when the page changes.
[0072] The transition of UITabBarController is relatively simple. By overriding the setSelectedController method in UITabBarController and throwing the current selectedController with the transition notification, you can get the currently visible page controller.
[0073] When the page tracker is constructed and initialized, it obtains the corresponding page controller from UINavigationController and UITabBarController and registers the transition notification. When the page tracker receives the transition notification, it can update the page according to the page controller obtained from UINavigationController and UITabBarController.
[0074] In a preferred embodiment, the page tracker can also be used to monitor the switching between the foreground and background of the APP of the mobile device. When the APP switches to the background, the page of the APP is set to empty to release the resources of the APP. Conversely, when the APP switches to the foreground, the page of the APP is restored.
[0075] Extracting the changed page according to the context of the transition change;
[0076] If the page changes from a visible state to an invisible state, the corresponding changed page is added to a preset clearing area; wherein, the preset clearing area will remove a page in the clearing area and perform memory clearing every preset clearing time in the order of entering the clearing area from the first to the last.
[0077] Specifically, the clearing area can be set as a clearing queue. When the clearing area is set as a clearing queue, the changed pages enter the clearing queue from the end of the queue in order by enqueuing. When page clearing is required, the page to be cleared is moved out of the clearing queue at the head of the clearing queue.
[0078] If the page changes from an invisible state to a visible state, the corresponding changed page is removed from the preset clearing area; it is determined whether the acquired changed page has been cleared, and if so, the changed page is restored. S4: Obtaining the memory status after the page changes;
[0079] Specifically, in this embodiment, after obtaining the memory status after the page change, it can be associated with the context of the changed page and recorded, so as to facilitate subsequent observation of the memory change status corresponding to the page change according to the context and memory status of the changed page.
[0080] S5: acquiring the current memory pressure level according to the memory condition after the page change, and performing memory adjustment according to the current memory pressure level and the processed changed page.
[0081] Specifically, in this embodiment, the memory adjustment according to the current memory pressure level and the processed changed page specifically includes:
[0082] According to a preset memory adjustment strategy, the resources of the currently displayed page are released, the pages in the clearing area are removed, and the memory of the cleared pages is cleared;
[0083] The memory adjustment strategy includes: if the current memory pressure level is higher, the operation of releasing the resources of the currently displayed page is performed first.
[0084] Exemplarily, the memory pressure level is divided into three levels, which are the first level, the second level and the third level in order from the largest to the smallest maximum value of the memory interval, wherein the maximum value of the memory interval of the third level is the memory overflow threshold. If the current memory pressure level is the third level, it means that the current used memory of the mobile device is close to the memory overflow threshold, and the memory overflow is about to be triggered, so it is necessary to properly release the resources of the currently displayed page, and at the same time, remove several pages in the clearing area, and clear the memory occupied by them, thereby reducing the memory pressure level and avoiding the APP corresponding to the currently displayed page from crashing; if the current memory pressure level is the second level, it means that the current used memory of the mobile device has not reached the memory overflow threshold, but in order to prevent the invisible pages in the background from accumulating continuously, it is also necessary to properly clear the pages in the clearing area; and if the current memory pressure level is the lowest first level, it means that the current used memory of the mobile device is very low, and there is no need to actively clear the memory. The clearing strategy of the clearing area itself can be relied on to clear the pages at regular intervals.
[0085] It is understandable that no matter which memory pressure level the mobile device is in, the mobile device will perform memory cleanup on the page, and as the memory pressure level continues to increase, the memory cleanup of the mobile device will become more and more active, such as reducing the time interval for memory cleanup of the clearing area, and actively clearing the pages in the clearing area. At the same time, as the memory pressure level increases, the mobile device will begin to prioritize clearing some occupied resources of the current display page, such as releasing all dynamic images on the current page, retaining only the URL address of the dynamic image, and re-requesting the image according to the URL when recovery is needed.
[0086] This embodiment adopts the method of timed incremental memory to more accurately obtain the memory overflow threshold of the mobile device of different models and different manufacturers. When a more accurate memory overflow threshold is obtained, the memory pressure level of the mobile device can be better divided, and the memory of the mobile device can be managed according to the memory pressure level.
[0087] Based on the same inventive concept, this embodiment also provides a memory management device, such as Figure 3As shown, the management device may include:
[0088] A threshold acquisition module 11 is used to acquire a memory overflow threshold of a mobile device by means of a timed incremental memory;
[0089] In this embodiment, the threshold acquisition module 11 can be used to perform Figure 2 As shown in step S1, for the specific description of the threshold acquisition module 11, reference may be made to the description of step S1.
[0090] A level classification module 12, used to classify the memory pressure level of the mobile device according to the memory overflow threshold;
[0091] In this embodiment, the level classification module 12 can be used to perform Figure 2 As shown in step S2, for the detailed description of the level classification module 12, reference may be made to the description of step S2.
[0092] A monitoring and processing module 13 is used to monitor page changes of the mobile device and process the changed pages according to the page changes;
[0093] In this embodiment, the monitoring processing module 13 can be used to perform Figure 2 As shown in step S3, for the detailed description of the monitoring and processing module 13, reference may be made to the description of step S3.
[0094] The memory recording module 14 is used to obtain the memory status after the page changes;
[0095] In this embodiment, the memory recording module 14 can be used to execute Figure 2 As shown in step S4, for the specific description of the memory recording module 14, reference may be made to the description of step S4.
[0096] The memory adjustment module 15 is used to obtain the current memory pressure level according to the memory situation after the page is changed, and perform memory adjustment according to the current memory pressure level and the changed page after processing.
[0097] In this embodiment, the memory adjustment module 15 can be used to execute Figure 2 As shown in step S5, for the specific description of the memory adjustment module 15, reference may be made to the description of step S5.
[0098] Based on the same inventive concept, this embodiment also provides an electronic device, Figure 4The structure diagram of the electronic device of this embodiment is shown, which includes a memory 21 and a processor 22. The memory 21 stores computer-readable instructions, and the processor 22 executes the computer-readable instructions to implement the memory management method of this embodiment.
[0099] Preferably, the electronic device further includes a bus 23 and a communication interface 24 , and the processor 22 , the communication interface 24 and the memory 21 are connected via the bus 23 .
[0100] The memory 21 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 24 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 23 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus 23 may be divided into an address bus, a data bus, a control bus, etc. (not fully drawn in the figure).
[0101] The processor 22 may be an integrated circuit chip with signal processing capability. In the specific implementation process, each step in the above method embodiment may be completed by the hardware integrated logic circuit or software instructions in the processor 22. The above processor 22 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, which may implement or execute the methods, steps, and logic diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or the processor 22 may also be any conventional processor 22, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 21, and the processor 22 reads the information in the memory 21 and completes the steps of the method of the above embodiment in combination with its hardware.
[0102] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor 22, the computer-executable instructions prompt the processor 22 to implement a memory management method described above. The specific implementation can be found in the embodiment and will not be repeated here.
[0103] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0104] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solution of the present invention, and are not intended to limit the specific implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the claims of the present invention shall be included in the protection scope of the claims of the present invention.
Claims
1. A memory management method, characterized in that: The management method comprises: Obtain the memory overflow threshold of the mobile device by increasing the memory at a fixed time. Dividing the memory pressure level of the mobile device according to the memory overflow threshold; Monitoring page changes of the mobile device, and processing the changed pages according to the page changes; Get the memory status after the page changes; The current memory pressure level is obtained according to the memory condition after the page change, and memory adjustment is performed according to the current memory pressure level and the processed changed page.
2. A memory management method according to claim 1, characterized in that: The method of obtaining the memory overflow threshold of the mobile device by means of timed memory increment specifically includes: Applying for a preset memory size from the mobile device at regular intervals; When the mobile device triggers a memory overflow, recording the total memory size currently used by the mobile device; The total memory size when memory overflow occurs for several times is obtained, and the memory overflow threshold is obtained according to the total memory size when memory overflow occurs for several times.
3. A memory management method according to claim 1, characterized in that: The dividing the memory pressure level of the mobile device according to the memory overflow threshold specifically includes: Dividing the memory overflow threshold into a plurality of memory intervals according to a preset ratio; The memory pressure level is allocated to the memory interval according to the upper limit value of the memory interval and the divided memory interval situation.
4. A memory management method according to claim 1, characterized in that: The page change at least includes: the page changes from a visible state to an invisible state, and the page changes from an invisible state to a visible state.
5. A memory management method according to claim 4, characterized in that: The monitoring of page changes of the mobile device and processing the changed page according to the page changes specifically includes: Monitoring a scene change notification of the mobile device, and acquiring a context of the scene change according to the scene change notification; Extracting the changed page according to the context of the transition change; If the page changes from a visible state to an invisible state, the corresponding changed page is added to a preset clearing area; If the page changes from an invisible state to a visible state, the corresponding changed page is removed from the preset clearing area; it is determined whether the acquired changed page has been cleared, and if so, the changed page is restored.
6. A memory management method according to claim 5, characterized in that: The preset clearing area removes a page from the clearing area and performs memory clearing at every preset clearing time according to the order of entering the clearing area.
7. A memory management method according to any one of claims 5 or 6, characterized in that: The memory adjustment according to the current memory pressure level and the processed changed page specifically includes: According to a preset memory adjustment strategy, the resources of the currently displayed page are released, the pages in the clearing area are removed, and the memory of the cleared pages is cleared; The memory adjustment strategy includes: if the current memory pressure level is higher, the operation of releasing the resources of the currently displayed page is performed first.
8. A memory management device, characterized in that: The management device comprises: A threshold acquisition module is used to obtain the memory overflow threshold of the mobile device by means of timed memory increment; A level classification module, used to classify the memory pressure level of the mobile device according to the memory overflow threshold; A monitoring and processing module, used to monitor page changes of the mobile device and process the changed pages according to the page changes; Memory recording module, used to obtain memory status after page changes; The memory adjustment module is used to obtain the current memory pressure level according to the memory situation after the page changes, and to perform memory adjustment according to the current memory pressure level and the processed changed page.
9. An electronic device, comprising a memory and a processor, characterized in that: The memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement a memory management method as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: A computer executable program is stored thereon, and when the computer executable program is executed, a memory management method as described in any one of claims 1 to 7 is implemented.