Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Size of cached objects by SDWebImage

I wanted to calculate the current in-memory size occupied by SDWebImage (Not the max size of SDWebImage). During the application usage i need to track the current RAM allocation by SDWebImage cached objects.

Basically i wanted to calculate the size of all images (present at that time) in NSCache object.

How can i do this ?

Thanks.

like image 332
Karthik207 Avatar asked Mar 14 '23 13:03

Karthik207


1 Answers

I think this will return Memory Cache using given code.

Use getSize function of SDImageCache.h. Which returns in memory cache.

[[SDImageCache sharedImageCache] getSize];

Follow SDWebImage for more details.

like image 101
technerd Avatar answered Apr 03 '23 04:04

technerd