Greetings
does MemoryCache save data on the phone memory or the the sd card of the phone?
Do the below lines return me the exact memory accessed by MemoryCache
Runtime rt = Runtime.getRuntime();
freecache = rt.freeMemory();
Thank you
Just FYI: modern devices (such as S60) are often use 'dynamic heap' and they allocate heap on demand. So they report currently allocated heap in Runtime.totalMemory(), increasing it when free memory is not enough for new bunch of data.
So calculations for the cache size are even more problematic...
MemoryCache stores to RAM memory only, so it is not persistent. RMS cache keeps data in RMS, and for Android we have also persistent caching in filesystem (with an index in SQLlite).
I would not suggest to use this automatic approach to find out optimal memory, different devices may report different numbers for freeMemory() from 0 to all available memory. Based on device group optimal memory amount should be found and pre-defined.
/JaakL