Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Latest news

Last at Tue, 3 Apr 2012 23:31:42
Topic: MapXT SDK evaluation
See more news »

MemoryCache issue

2 replies [Last post]
eliehaddad
User offline. Last seen 1 year 20 weeks ago. Offline
Joined: 08/27/2008

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

EGH

jaak
User offline. Last seen 15 hours 16 min ago. Offline
Joined: 06/19/2008

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

mixa
User offline. Last seen 1 year 16 weeks ago. Offline
Joined: 01/13/2010

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...