Re: Relieving memory pressure

2020-06-08 Thread Alex Zavatone via Cocoa-dev
> On Jun 7, 2020, at 3:15 PM, Steve Christensen via Cocoa-dev > wrote: > > For slide shows that I’ve seen, they typically display each image for several > seconds at a time. If that’s the case, why can’t you just load the next image > from disk on a background queue while the current image

Re: Relieving memory pressure

2020-06-07 Thread Jens Alfke via Cocoa-dev
> On Jun 7, 2020, at 3:27 AM, Gabriel Zachmann via Cocoa-dev > wrote: > > For large images, this "thumbnail" can well occupy 1 GB of RAM. That seems excessive. Shouldn’t you shrink it down to the actual screen resolution first? > My current approach is to calculate the amount of unused

Re: Relieving memory pressure

2020-06-07 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for your response. > If that’s the case, why can’t you just load the next image from disk on a > background queue while That is what I'm doing, since loading the next image could take up to 9 seconds. > the current image is being displayed and not have to worry about memory usage

Re: Relieving memory pressure

2020-06-07 Thread Steve Christensen via Cocoa-dev
For slide shows that I’ve seen, they typically display each image for several seconds at a time. If that’s the case, why can’t you just load the next image from disk on a background queue while the current image is being displayed and not have to worry about memory usage needed to cache

Re: Relieving memory pressure

2020-06-07 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for the hints - I'll look into the different ideas. Also thanks to Christos for his hints. Best regards, Gabriel smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: Relieving memory pressure

2020-06-07 Thread Gary L. Wade via Cocoa-dev
The vast majority of data used by a CGImageRef for any sufficiently representable image is going to be its bitmap data (a 1x1 pixel image wouldn’t), and you can calculate that by using CGImageGetBytesPerRow and its neighbor APIs. If I recall from your previous posts, you are showing very

Re: Relieving memory pressure

2020-06-07 Thread Gabriel Zachmann via Cocoa-dev
Good question. Well, some users want to feed my app with image files of 100 MB, even up to 400 MB (mostly jpeg compressed). Those images have resolutions of over 8k, sometimes over 10k. The slideshow app needs to be able to zoom into those images with at least a factor 2x scaling. So I

Relieving memory pressure

2020-06-07 Thread Gabriel Zachmann via Cocoa-dev
I am developing a slideshow app; one of its features is that it keeps a history of the last N images it has displayed. It keeps kind of a cache , where it stores, among other things, the image returned by CGImageSourceCreateThumbnailAtIndex(), because this is one of the expensive operations.