Cache Size Limit

Sep 29, 2010 at 1:25 PM

Hi radioman,

Thanks for developing a great control.  Is there any way to limit the size of the cache file?  My mobile device has only 4 MB of storage space left, and the cache continues to grow.  

My application requires that the user is able to download new tiles, so building a prefetched cache and limiting the application to CacheOnly is not an option.

Is there any way to limit the cache size to a set number of MB?  It would be really cool if, once the cache has been filled to capacity, the oldest tiles would be replaced by new ones.  Your thoughts?


Thanks again for all of your hard work!  


Sep 29, 2010 at 3:41 PM

4MB == 10 tiles? ;}

Sep 29, 2010 at 3:56 PM

I am very much aware of that.... and my Data.gmdb file is already over 200MB.  

So at this point, what would I have the users of my application do?

1) Delete their cache and start over?

2) Prefetch another cache when the device runs out of storage every so often?

3) Adopt some kind of seamless solution.


I am hoping for number 3, and if something already exists in the current control, then I'd like to use it.  Otherwise, I will have to develop something.

Sep 29, 2010 at 4:02 PM
Edited Sep 29, 2010 at 4:02 PM

well deleting items from database doesn't compact it, anyway you can optimize after deleting old tiles, that will do, but on mobile these things will be slow, ...why not use sd card, it works with 1GB cache and more

Sep 29, 2010 at 4:37 PM

Thanks for the quick responses radioman.

An SD card is suggested, but our end users may be less than tech-savvy :-)

Therefore, I am trying to devise a "just works" solution.  The fact that the cache file can grow ad infinitum is a concern of mine...

Does ability to remove tiles and optimize database exist on Mobile implementation?

Sep 29, 2010 at 4:42 PM

there is no implemented code for deletion of old tiles

Sep 29, 2010 at 5:25 PM

Thanks radioman.

I may explore the technique that you suggest.  I am aware of the MapControl.Manager.OptimizeMapDb(file) function on the WinForms control, but it does not exist on mobile.  Do you know if this functionality is absent from the mobile implementation of SQLite?  If it is altogether missing from SQLite, then the task becomes much more difficult....

Thanks for your help.


Sep 29, 2010 at 5:52 PM

i removed it in mobile version for a reason, optimizing 1GB cache would be infinity process ;} you can uncomment it if you want to use it

Sep 29, 2010 at 6:14 PM

Infinity process, haha!

I'm feeling kind of dangerous, so I will give it a shot and see what happens. If it takes a long time, no problem -- I am patient.  Besides, I once read the words of a wise man who wrote:  "i have whole lifetime, no rush ;}"

Thanks again radioman, and keep up the good work!