CN111524059A - Memory utilization method, system, terminal and storage medium during image caching - Google Patents

Memory utilization method, system, terminal and storage medium during image caching Download PDF

Info

Publication number
CN111524059A
CN111524059A CN201910105014.2A CN201910105014A CN111524059A CN 111524059 A CN111524059 A CN 111524059A CN 201910105014 A CN201910105014 A CN 201910105014A CN 111524059 A CN111524059 A CN 111524059A
Authority
CN
China
Prior art keywords
memory
image
occupied
cached
occupation amount
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.)
Pending
Application number
CN201910105014.2A
Other languages
Chinese (zh)
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.)
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Kingsoft Mobile Technology Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Guangzhou Kingsoft Mobile Technology 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 Beijing Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd, Guangzhou Kingsoft Mobile Technology Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN201910105014.2A priority Critical patent/CN111524059A/en
Publication of CN111524059A publication Critical patent/CN111524059A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/508Monitor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses a memory utilization method, a system, a terminal and a storage medium during image caching, wherein the method comprises the following steps: monitoring the memory occupation amount in the image caching process; and when the memory occupation amount exceeds a preset threshold value, releasing part of the occupied memory. The invention can avoid the memory resource from being excessively occupied when the image is cached.

Description

Memory utilization method, system, terminal and storage medium during image caching
Technical Field
The present invention relates to a memory management technology, and in particular, to a method, a system, a terminal, and a storage medium for utilizing a memory during image caching.
Background
When the computer stores images, a large amount of memory is often occupied, if the memory is excessively occupied, the running speed of the computer is reduced, even the computer is halted, the running of other programs of the computer is influenced, and the user experience is reduced.
Disclosure of Invention
In order to solve the technical problem, the invention provides a memory utilization method, a system, a terminal and a storage medium during image caching, which can avoid excessive occupation of memory resources during image caching.
In order to achieve the purpose of the invention, the invention provides a memory utilization method during image caching, which comprises the following steps:
monitoring the memory occupation amount in the image caching process;
and when the memory occupation amount exceeds a preset threshold value, releasing part of the occupied memory.
As an implementation manner, the monitoring memory usage amount in the image caching process includes:
recording the space occupied by each cached image in the memory;
and according to the occupied space of each cached image in the memory, accumulatively calculating the total size of the memory occupied by all cached images.
As an implementation manner, the releasing the partially occupied memory when the memory occupied amount exceeds a preset threshold includes:
when the memory occupation amount exceeds a preset threshold value, sequencing all cached images according to the sequence of image caching;
and sequentially cleaning the images from the image cached at first, and releasing the memory until the memory occupation amount is less than or equal to a preset threshold value.
The embodiment of the present invention further provides a memory utilization system during image caching, including:
the monitoring module is used for monitoring the memory occupation amount in the image caching process;
and the control module is used for releasing part of occupied memory when the memory occupation amount exceeds a preset threshold value.
As an implementation manner, the monitoring module is configured to monitor the memory usage amount in the image caching process, and includes:
recording the space occupied by each cached image in the memory;
and according to the occupied space of each cached image in the memory, accumulatively calculating the total size of the memory occupied by all cached images.
As an implementation manner, the control module is configured to release a portion of occupied memory when the memory occupancy exceeds a preset threshold, and includes:
when the memory occupation amount exceeds a preset threshold value, sequencing all cached images according to the sequence of image caching;
and sequentially cleaning the images from the image cached at first, and releasing the memory until the memory occupation amount is less than or equal to a preset threshold value.
The embodiment of the present invention further provides a computer-readable storage medium, where the medium stores computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the steps of the memory utilization method during image caching as described above.
The embodiment of the invention also provides a memory utilization terminal during image caching, which comprises:
a memory for storing computer executable instructions;
a processor configured to execute the computer-executable instructions to implement the steps of the image cache memory utilization method.
Compared with the prior art, the invention comprises the following steps: monitoring the memory occupation amount in the image caching process; and when the memory occupation amount exceeds a preset threshold value, releasing part of the occupied memory. The invention can avoid the memory resource from being excessively occupied when the image is cached.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
Fig. 1 is a flowchart of a memory utilization method during image caching according to an embodiment of the present invention;
fig. 2 is a block diagram of a memory utilization system during image caching according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
An embodiment of the present invention provides a memory utilization method during image caching, as shown in fig. 1, the method includes:
s101, monitoring the memory occupation amount in the image caching process;
as an implementation manner, the monitoring memory usage amount in the image caching process includes:
recording the space occupied by each cached image in a memory, wherein the space occupied by the cached image in the memory can be obtained by calculation when the image is cached;
and according to the occupied space of each cached image in the memory, accumulatively calculating the total size of the memory occupied by all cached images.
S102, when the occupied memory amount exceeds a preset threshold value, releasing a part of occupied memory;
the preset threshold value can be set by a technician according to the actual use condition of the computer.
As an implementation manner, the releasing the partially occupied memory when the memory occupied amount exceeds a preset threshold includes:
when the memory occupation amount exceeds a preset threshold value, sequencing all cached images according to the sequence of image caching;
and sequentially cleaning the images from the image cached at first, and releasing the memory until the memory occupation amount is less than or equal to a preset threshold value.
As an implementation mode, the embodiment of the invention can store the cached images by utilizing the list, and the sequence of the image caching can be clearly known through the list;
according to the embodiment of the invention, when the memory occupied by the image cache is too large, the memory occupied by the cached image can be deleted, so that the memory resource is prevented from being excessively occupied, and the use experience of a user is ensured.
An embodiment of the present invention further provides a memory utilization system during image caching, as shown in fig. 2, the system includes:
the monitoring module 201 is configured to monitor memory occupancy during an image caching process;
as an implementation manner, the monitoring module 201 is configured to monitor the memory occupation amount in the image caching process, and includes recording the size of a space occupied by each cached image in the memory; according to the occupied space of each cached image in the memory, the total size of the memory occupied by all cached images is calculated in an accumulated way;
the control module 202 is configured to release a part of occupied memory when the memory occupied amount exceeds a preset threshold;
as an implementation manner, the control module 202 is configured to release a portion of the occupied memory when the memory usage amount exceeds a preset threshold, including:
when the memory occupation amount exceeds a preset threshold value, sequencing all cached images according to the sequence of image caching; and sequentially cleaning the images from the image cached at first, and releasing the memory until the memory occupation amount is less than or equal to a preset threshold value. As an implementation manner, the embodiment of the invention can store the cached images by using the list, and the sequence of the image caching can be clearly known through the list.
According to the embodiment of the invention, when the memory occupied by the image cache is too large, the memory occupied by the cached image can be deleted, so that the memory resource is prevented from being excessively occupied, and the use experience of a user is ensured.
The embodiment of the present invention further provides a computer-readable storage medium, where the medium stores computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the steps of the memory utilization method during image caching according to the foregoing embodiment.
The embodiment of the invention also provides a memory utilization terminal during image caching, which comprises:
a memory for storing computer executable instructions;
a processor, configured to execute the computer-executable instructions to implement the steps of the image cache memory utilization method according to the foregoing embodiment.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.

Claims (8)

1. A memory utilization method during image caching is characterized by comprising the following steps:
monitoring the memory occupation amount in the image caching process;
and when the memory occupation amount exceeds a preset threshold value, releasing part of the occupied memory.
2. The method for utilizing the memory during image caching according to claim 1, wherein the monitoring of the memory occupation amount during the image caching process comprises:
recording the space occupied by each cached image in the memory;
and according to the occupied space of each cached image in the memory, accumulatively calculating the total size of the memory occupied by all cached images.
3. The method for utilizing the memory during image caching according to claim 2, wherein the releasing the partially occupied memory when the memory occupation amount exceeds a preset threshold value comprises:
when the memory occupation amount exceeds a preset threshold value, sequencing all cached images according to the sequence of image caching;
and sequentially cleaning the images from the image cached at first, and releasing the memory until the memory occupation amount is less than or equal to a preset threshold value.
4. A memory utilization system during image caching, comprising:
the monitoring module is used for monitoring the memory occupation amount in the image caching process;
and the control module is used for releasing part of occupied memory when the memory occupation amount exceeds a preset threshold value.
5. The image caching memory utilization system according to claim 4, wherein the monitoring module is configured to monitor memory usage during image caching, and includes:
recording the space occupied by each cached image in the memory;
and according to the occupied space of each cached image in the memory, accumulatively calculating the total size of the memory occupied by all cached images.
6. The image cache memory utilization system according to claim 5, wherein the control module is configured to release a part of the occupied memory when the memory occupancy exceeds a preset threshold, and the release step includes:
when the memory occupation amount exceeds a preset threshold value, sequencing all cached images according to the sequence of image caching;
and sequentially cleaning the images from the image cached at first, and releasing the memory until the memory occupation amount is less than or equal to a preset threshold value.
7. A computer-readable storage medium storing computer-executable instructions which, when executed by a processor, implement the steps of the method for memory utilization while caching images according to any one of claims 1 to 3.
8. A terminal for utilizing memory during image caching is characterized by comprising:
a memory for storing computer executable instructions;
a processor for executing the computer-executable instructions to implement the steps of the image cache-time memory utilization method of any one of claims 1 to 3.
CN201910105014.2A 2019-02-01 2019-02-01 Memory utilization method, system, terminal and storage medium during image caching Pending CN111524059A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910105014.2A CN111524059A (en) 2019-02-01 2019-02-01 Memory utilization method, system, terminal and storage medium during image caching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910105014.2A CN111524059A (en) 2019-02-01 2019-02-01 Memory utilization method, system, terminal and storage medium during image caching

Publications (1)

Publication Number Publication Date
CN111524059A true CN111524059A (en) 2020-08-11

Family

ID=71910489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910105014.2A Pending CN111524059A (en) 2019-02-01 2019-02-01 Memory utilization method, system, terminal and storage medium during image caching

Country Status (1)

Country Link
CN (1) CN111524059A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114691452A (en) * 2022-03-24 2022-07-01 北京百度网讯科技有限公司 Memory monitoring method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912480A (en) * 2016-04-01 2016-08-31 乐视控股(北京)有限公司 Cache management method, device and mobile terminal
CN107526641A (en) * 2017-08-28 2017-12-29 青岛海信移动通信技术股份有限公司 A kind of method and device for reclaiming internal memory

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912480A (en) * 2016-04-01 2016-08-31 乐视控股(北京)有限公司 Cache management method, device and mobile terminal
CN107526641A (en) * 2017-08-28 2017-12-29 青岛海信移动通信技术股份有限公司 A kind of method and device for reclaiming internal memory

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
WORTHSEN: "RAM、ROM、内存还有硬盘,它们到底有什么区别", pages 2, Retrieved from the Internet <URL:https://blog.csdn.net/qq_38880380/article/details/78884202> *
上海市计算机应用能力考核办公室: "计算机应用教程—— 计算机硬件基础", 31 March 2003, 上海交通大学出版社, pages: 27 - 28 *
罗蓁蓁: "RAM、ROM和硬盘的总结", pages 1 - 2, Retrieved from the Internet <URL:https://www.jianshu.com/p/3d0b3af6cc59> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114691452A (en) * 2022-03-24 2022-07-01 北京百度网讯科技有限公司 Memory monitoring method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110413412B (en) GPU (graphics processing Unit) cluster resource allocation method and device
US11150949B2 (en) Resource release method, resource allocation method, devices, and computer program products
CN110971623B (en) Micro-service instance elastic scaling method and device and storage medium
CN112214288B (en) Pod scheduling method, device, equipment and medium based on Kubernetes cluster
CN112214313A (en) Memory allocation method and related equipment
CN105786539B (en) File downloading method and device
CN111309644A (en) Memory allocation method and device and computer readable storage medium
CN107665143B (en) Resource management method, device and system
CN111245732A (en) Flow control method, device and equipment
CN112020079B (en) Wireless communication device and method for electronic equipment, electronic equipment and storage medium
US11201828B2 (en) Stream allocation using stream credits
CN111524059A (en) Memory utilization method, system, terminal and storage medium during image caching
US20210203614A1 (en) Resource allocation using distributed segment processing credits
CN110555009B (en) Processing method and device for Network File System (NFS) service
US11005776B2 (en) Resource allocation using restore credits
CN112527490B (en) Node resource management and control method and device, electronic equipment and storage medium
CN109284275B (en) Cloud platform virtual machine file system monitoring method and device
CN113127179A (en) Resource scheduling method and device, electronic equipment and computer readable medium
CN113691879B (en) Video data processing method, electronic device, and computer-readable storage medium
CN108920264A (en) A kind of command timeout processing method and system
CN110968328A (en) Method and device for realizing application loading, computer storage medium and terminal
CN115774614A (en) Resource regulation and control method, terminal and storage medium
US20210352295A1 (en) Video processing method, system, device and computer-readable storage medium
CN110929102B (en) Data processing method and device and electronic equipment
CN117519988B (en) RAID-based memory pool dynamic allocation method and device

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