How is an app’s cache memory related to the app restarting or stopping?

Drsunil V May 7, 2014

How is the cache memory of an app in Android 4.0 (Jelly Bean) connected to the app’s restarting on stopping the app?

If cache memory of app is deleted and then app is stopped, would the app be prevented from restarting? Or if cache memory is not deleted then can an app be prevented from restarting?

  1. Oron J
    May 8, 2014 at 5:14 pm

    I'm not sure if stopping an app would empty delete the cache (I don't think so, but am not certain). At any rate, deleting the cache would not interfere with the operation of the app apart from, as Hovsep points out, slowing it down a little initially.
    The cache is an additional mechanism for speeding up read/write operations. Having an empty cache is allowed -- it's the natural state of affairs when you start using an app!

    • Drsunil V
      May 9, 2014 at 4:13 pm

      Thanks. Please tell , how would deleting cache of an app prevent / no prevent an intentionally stopped app from re-starting?

    • Oron J
      May 10, 2014 at 12:24 pm

      It would not. It has nothing to do with intentionally stopped (and/or restarted) apps.

    • Drsunil V
      May 19, 2014 at 12:58 pm

      Do you mean that cache memory is actually utilized in launching app quicker?

    • Oron J
      May 19, 2014 at 1:41 pm

      Yes, the cache will speed up relaunch of the app, but more importantly, the app itself will appear more responsive if a substantial amount of data was cached.

    • Drsunil V
      May 20, 2014 at 5:09 pm

      thanks. Got your point. Though clarified , i request you to reiterate that a) "having memory in cache would encourage the app to restart" and vice versa" b) if an app's cache memory is zero then the app is less likely to restart"? Ans to a) and b) : Yes or No?

    • Oron J
      May 23, 2014 at 7:14 am

      The answer to (a) is No and to (b) is also No.
      Caching is simply a way to speed up access to data that's been used in the past. That's all.

    • Drsunil V
      May 23, 2014 at 5:01 pm

      a) Is "not deleting" cache actually beneficial? , b) "not deleting" cache would preventing app from utilizing phone internet for adding cache for app? and thus a) and b) would help in reducing mobile internet usage? ( esp important for limited data packs )

    • Oron J
      May 26, 2014 at 10:47 am

      Yes, the cache is there for a reason (to speed up the app) and is best to be left alone. It should only be deleted in special circumstances. I can think of two such circumstances:
      1. Diagnostics. Iif an app crashes or behaves strangely, it could be because of the cache having become corrupt. Deleting the cache helps confirm or refute that hypothesis.
      2. Deleting data that shouldn't fall into other people's hands. This would be truly exceptional, but I suppose the situation might arise.

    • Drsunil V
      May 27, 2014 at 4:35 pm

      i understand

  2. Hovsep A
    May 7, 2014 at 7:57 pm

    if cache is deleted then this does not prevent you to restart the application, perhaps it will take a little longer to restart. Deleting cache is not deleting application

    Empty Processes To improve overall system performance, Android often retains applications in memory after they have reached the end of their lifetimes. Android maintains this cache to improve the start-up time of applications when they’re re-launched. These processes are rou- tinely killed as required.

    Managing Your App's Memory

    Manage memory usage

    • Drsunil V
      May 9, 2014 at 4:10 pm

      Thanks. Please note , to rephrase and what is implied to be asked : If an app is stopped a) with cache memory and b) without cache memory , then there is likelihood of app restarting in a) or b) ? In other words , how to prevent an intentionally stopped app , from re-starting in relation to it's cache memory?

    • Hovsep A
      May 9, 2014 at 6:18 pm

      well when you stop an application with and withour cache memory then it is stopped, unless another application needs a particular stopped application to work then this particular application some services will be relaunched, most likely this can be some google android applications state. If an application is topped with cache memory and if android ram manager needs that place then cache will be purged to relocate

    • Drsunil V
      May 19, 2014 at 12:55 pm

      I understood partially. Please tell , that if cache memory is deleted and then app is 'stopped' through running process section of manage apps in android 4.0 , then would it make difference to app restarting than when app is 'stopped' in same way but with cache memory not deleted? Ans : Yes or No?

    • Hovsep A
      May 19, 2014 at 2:51 pm

      well cache help things to load faster, if you clear cache then application will take a little longer to start (compared when cache is not deleted) and then perhaps you will to re-enter data if the application needs password, online registration...The effect of clearing cache may vary depending on applications. It's up to the application developer to decide on how they want app data to be stored. Cache is a non-persistent storage option that the android OS is given permission to delete without prompting the user if it needs to.

      Android Uses Two Kind of Mechanism: .LRU Cache(Internal application memory used) 2.Disk Cache(sdcard memory used)
      A memory cache is useful in speeding up access to recently viewed bitmaps, however you cannot rely on images being available in this cache. Components like GridView with larger datasets can easily fill up a memory cache. Your application could be interrupted by another task like a phone call, and while in the background it might be killed and the memory cache destroyed. Once the user resumes, your application has to process each image again. Example Facebook Android uses Disk Cache
      Cache Memory is cleared in Application program level or Settings-Manage Applications-App Name.

      Manage Memory on Android 3.0 and Higher
      Android 3.0 (API level 11) introduces the BitmapFactory.Options.inBitmap field. If this option is set, decode methods that take the Options object will attempt to reuse an existing bitmap when loading content. This means that the bitmap's memory is reused, resulting in improved performance, and removing both memory allocation and de-allocation. However, there are certain restrictions with how inBitmap can be used. In particular, before Android 4.4 (API level 19), only equal sized bitmaps are supported.

Ads by Google