I am loading image from url on a image-view. If the resolution of the image is 4000 * 2400 ,size of image is 1.6MB then when I load image. Memory increase upto 30MB just for image load. But if size is less than 10 KB then size does not increase. I know I must use small image for loading as thumb image but just for learning I want to know this.
I am using below code to load image
self.imgStore.kf.setImage(with: url, placeholder: #imageLiteral(resourceName: "placeholder"), options: nil, progressBlock: { (val, val1) in }) { (image, error, cache, url) in
DILog.print(items: "image recived")
}
- Why memory size increase upto 30 MB when image size is just 1.5 Mb ?
- How can I handle if image from server is large but memory in app should not increase. ?