Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Image loading method and device

A picture loading and picture technology, applied in the field of picture processing, can solve the problems of easy triggering of OOM and large Java heap memory pressure, and achieve the effect of reducing trigger probability, reducing pressure, and improving picture loading efficiency

Active Publication Date: 2020-08-14
ADVANCED NEW TECH CO LTD
View PDF8 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The embodiment of the present application provides a picture loading method and device, which is used to solve the OOM problem that is easily triggered due to the high pressure of the Java heap memory when the existing picture caching method is used to realize the multiplexing of the decoded picture data. question

Method used

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

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Image loading method and device
  • Image loading method and device
  • Image loading method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0022] Embodiment 1 of the present application provides a picture loading method, which is applicable to any client or terminal device based on the Android system, without limitation. Specifically, such as figure 1 As shown, the picture loading method may include the following steps:

[0023] Step 101: When loading a picture, judge whether the decoded data of the picture is cached in the Native heap memory, if the judgment result is yes, execute step 102, otherwise, execute step 103.

[0024] Optionally, the decoded data of the picture is usually the pixel array data of the Bitmap object obtained by decoding the picture. In addition, because in the embodiment described in this application, for any picture, when the decoded data of the picture is cached in the Native heap memory, a corresponding Record data, therefore, to determine whether the decoded data of the picture is cached in the Native heap memory, the execution can be as follows:

[0025] Judging whether the record...

Embodiment 2

[0058] Based on the same inventive concept as the image loading method in Embodiment 1 of the present application, Embodiment 2 of the present application provides an image loading device. For the specific implementation of the image loading device, please refer to the relevant description in Embodiment 1 of the above-mentioned method. Repeated parts will not be repeated, specifically, such as image 3 As shown, the picture loading device may include:

[0059] The judging unit 31 can be used to judge whether the decoded data of the picture is cached in the Native heap memory when the picture is loaded;

[0060] The execution unit 32 can be used to obtain the decoded data of the picture from the Native heap memory if it is determined that the decoded data of the picture is cached in the Native heap memory, and realize the loading of the picture based on the obtained decoded data; otherwise, from the storage Acquire and load the picture from the storage space of the picture, an...

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

PUM

No PUM Login to View More

Abstract

This application discloses a picture loading method and device, which can cache the decoded picture data in the native heap memory, that is, the Native heap memory, so that the pictures can be reused when loading. In this way, because the Native heap memory is not counted in the application process Java heap memory, which can effectively reduce the pressure of Java heap memory and reduce the probability of OOM triggering. At the same time, it can also achieve better use of heap memory to realize image caching, so as to improve image loading efficiency and reduce the effect of system GC.

Description

technical field [0001] The present application relates to the technical field of image processing, in particular to an image loading method and device. Background technique [0002] For Android devices, when loading pictures, decoding pictures requires a large amount of Java heap memory in the application process, and the application process of the Android system has a certain size limit, so the Java heap memory usage rate of the application process is relatively high. , it is very easy to have insufficient heap memory, which triggers OOM (Out Of Memory, memory exhaustion). [0003] In order to solve this problem, picture caching can be used to reduce picture decoding, so as to realize the multiplexing of the decoded picture data, thereby reducing the usage rate of Java heap memory. For example, after the Bitmap (bitmap) object is decoded from the network or local resources, LRU (Least Recently Used) cache management can be implemented by using LinkedHashMap (a Map data str...

Claims

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

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F12/0875G06F12/02
CPCG06F12/0253G06F12/0875G06F2212/455G06F2212/1032G06T1/60G06T9/00G06T2200/28G06F12/0802
Inventor 李锦敏冯显桂余龙飞王远秋
Owner ADVANCED NEW TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products