The Market Cache

Sunday, January 25, 2009

The Market cache has been a source of grievance for many Android/G1 users. Applications under Android store data in caches that are cleaned up when memory is running low. The G1 has an unimpressive amount of onboard memory, and the Market browser has a cache that cannot be manually cleared. This has lead to many individuals performing factory data resets on their phones just to reclaim the sequestered memory.

The factory data reset is not the best approach. In fact, I would say that the best approach is to do nothing at all about the problem. By virtue of Android’s memory manager, caches are cleared automatically when memory is needed. For example, if the foreground task needs to do something memory-intensive and there are some background tasks and caches, some of the tasks could be killed or caches could be cleared to make room. So… the problem solves itself.

One does not need to manually reclaim the memory, but what’s wrong with doing it anyway? I mean, it does get rid of the low-memory warnings that are so distressing to some. However, the biggest problem with clearing caches is the act itself. Caches perform the useful function of storing objects so that they need not be computed or fetched again, saving processor, networking, and power resources. One can even say that memory exists mainly for the purpose of caching. Therefore, it would be optimal to fill the memory as much as possible with cache. The system that Google set up is almost perfect — it allows the memory to fill with cached data, clearing bits at a time only when needed for a foreground task.

But why isn’t it perfect? Well, I had mentioned the low-memory warnings earlier. When the average user sees one of these, he/she thinks that the phone is about to explode. It’s not; rather, it’s a sign that the memory manager is doing its job. The psychological aspect of the problem can be resolved by either removing this warning or making it appear more benign, reserving the real warning for when the memory is really running out.

In the interim, I’m going to hang onto my caches and encourage you to do the same. There is no harm in taking the need-based memory management approach. Remember, unused memory is wasted memory.


  1. maximosis says:

    Very well put, I going to root my phone soon and keep my caches on my sd card.

  2. Jiang Yio says:

    That’s a good idea. I shall wait and see, though — if the internal memory is faster than SD memory, I’d just store apps on the SD and use internal memory for caching.

  3. maximosis says:

    That’s a good approach as well; you do need to cache. I never factory reset my phone once and I had it since october.

  4. Jiang Yio says:

    If Google doesn’t release a patch allowing apps to be stored on the SD card, I might have to root my phone after all… heh. I reset my phone once, and that was because the accelerometer stopped responding. Other than that, I haven’t had any major issues. I saw the warning just once and didn’t think much of it.

  5. David says:

    Rooting is the way to go. Apps on SD. Caches on SD. Unlimited space!

  6. Tony says:

    it seems to me that the T-mobile G1 is only a ‘beta’ type product at the moment. The HTC magic that vodafone are selling/ offering as part of their plans is much tidier, much better lied out then the G1 AND more importantly, the updates are more frequant, patch more important security holes and improve functionality better then that of the G1.

    The standard flip-out keyboard on the G1 has such a wobble on it now, i’m scared to even use it. The screen creeks when pressed and the cemera is very poor quality indeed.

    With regards to T-mobile though, I think they are fantastic. The support they give is nothing short of excelent and the sales rep in the store was helpfull to the point of being over-helpfull, if there is such a thing!!

    The apps availabel now is ever increasing though, which is encuraging to find, means a lot of people/ companies are getting on the G1 band-waggon and finally embracing open-source as a means of supplying end users with the raw materials to do something fantastic. However, this is not the perfect phone for everyone, and newbies are sure to find themselves stuck in an ever growing list of complicated and labourious tasks to customise their phones.

    Google, it’s a good effort, but it could be SOOO much better if the edges has been more ‘polished’ and the end result a little bit more user friendly. T-mobile, Fantastic support from you guys, well done. Marvelous!

  7. Jiang Yio says:

    Yes, it does seem quite ‘beta’. However, it might be noting that it’s not too difficult to flash the G1 with firmware designed for the other Android phones. This way, I’m actually quite happy that the phone is so flexible: it could be made to work with newer firmware because it has all the necessary hardware.

    Your keyboard might need some tightening… though I’ve never had this problem. My screen creaks occasionally, but it’s easily fixable by turning on the vibrator motors.