Force stop and clear cache – Gary explains

**Understanding Force Stop and Clear Cache: A Guide to Managing Apps on Android**

In the world of Android devices, encountering a misbehaving app is an all-too-common occurrence. Whether it's freezing, crashing, or behaving erratically, knowing how to troubleshoot these issues can save frustration and downtime. Two common solutions often suggested by tech enthusiasts are "force stop" and "clear cache." This guide delves into what these terms mean, how they work, and why they can help resolve app issues.

**The Android OS: Based on the Linux Kernel**

Android operates on a modified version of the Linux kernel, which manages processes—logical containers for running applications. Each app runs within its own process, allowing the system to allocate resources like memory and CPU time effectively. These processes can be in different states: running (actively using CPU), runnable (ready to run), or sleeping (waiting for data).

**Force Stopping an App**

When an app misbehaves, a force stop is akin to abruptly restarting it. This action sends a signal to the Android OS to terminate the app's process, freeing up memory and closing all associated files. Force stopping ensures that the app is completely removed from active processes, preventing any further resource misuse.

**Why Does Force Stopping Help?**

If an app enters an infinite loop or becomes unresponsive, force stopping can reset its state. Upon reopening, the app starts fresh, potentially bypassing the issue that caused it to malfunction. This method is particularly useful for resolving glitches without uninstalling the app, preserving settings and data.

**The Cache Directory: Temporary Storage**

Apps utilize the cache directory to store temporary files, such as downloaded data or processed images. These files help improve performance by avoiding repeated downloads or processing. However, if cached files become corrupted or outdated, they can lead to app errors. Clearing the cache removes these files, forcing the app to refresh them upon next use.

**Interactions Between Force Stop and Clear Cache**

Force stopping an app terminates its process but doesn't automatically clear the cache. These are separate actions: force stop ends the app's execution, while clearing cache removes stored data. Both steps together can effectively troubleshoot issues caused by corrupted files or process glitches.

**Considerations and Best Practices**

- **Privacy:** Clearing cache typically doesn't affect sensitive user data, as cache files aren't critical for user accounts or passwords.

- **Frequency of Use:** Using force stop and clear cache is preferable to uninstalling apps unless persistent issues arise. However, avoid overusing these tools excessively on essential processes.

- **Effectiveness:** Combining both actions often yields the best results, ensuring a clean slate for the app's operation.

In conclusion, understanding Android's process management and caching mechanisms empowers users to troubleshoot effectively. Force stopping an app and clearing its cache can resolve numerous issues, restoring smooth functionality without drastic measures like uninstallation.

"WEBVTTKind: captionsLanguage: enhello there my name is Gary Sims from Android authority now if you've ever had a misbehaving app on your smartphone maybe you've looked around the internet you've read some forums and somewhere on the line someone has said to you you should do a for stop and a clear cache that will help your problem so the question before us today what is a four stop what is a cash and why does a four stop and clear cash actually help fix misbehaving apps well let me explain okay at the very heart of Android is the Linux kernel and inside of Linux all programs that run run in a thing called a process and the process is a logical container that allows the kernel to know about which programs are running which memory is allocated to them what priority they have how much C CPU time they need and basically in Android every app that you run actually runs inside of a Linux process now I won't go into much more now about Linux process I've done a whole video on processes and threads that you can find here on the Android authority Channel if you go to the front page of the Android authority Channel you'll see a playlist for all of Gary explains videos and you can easily find it in there now when you start an application it starts a Linux process and it can basically go through some different states now at the Linux level it can go through running runnable and sleeping so in a process is for example actually on the CPU it's running when it's ready to run on the CPU it's runnable and when it's waiting for something to happen like Network traffic it's known as sleeping now Android also has some different states for the activities which make up your app and those activities include running and paused and stopped and basically what happens is is that Linux uh sorry Android can say to an app you are now in the pause state or you're going to be stopped which tells it it's going to kill it off or it's going to have to need to save some of its data it's about to be killed and what's interesting is when Android wants to stop an app it doesn't actually stop the app it just says to Linux kill that process which means that the process gets obliterated out of memory all of the memories freed up it's not given any more CPU time all the files that it had opened are closed any locks that it had open are freed and so on basically when Linux kills off the process everything just disappears which is a great way to ensure that the app has actually just completely gone and just like Android can tell Linux to kill a process you can tell Android to tell Linux to kill a process and that's what force stop does basically you say to Android I want this process to stop and it will obliterate it from memory and it will be definitely gone now the reason why that helps is because if you have a misbehaving app it's got itself into a funny loop it's got itself into a funny condition and it's not recovering then by ding a false stop you're actually killing off the pro and then when you restart it it may very well start back up into a better State and start functioning as it needs be another good thing about four stop is that once the process has been deleted then all the open files have been closed which means we know the files inside the cache directory are now no longer being used so what's the cach directory basically the cache directory is a place where an app can store temporary files for example if when the app starts up it needs to download something from the internet maybe a data feed maybe some images it could just download those things every time it starts up or every time you refresh the display but of course that will take a long time and it will also use up your bandwidth much better to get it periodically and then store the files in the cache and then from time to time the app can say hey should I update these uh files that are in my cache or are they okay at the moment and it would also be true for example if it was doing some processing maybe it downloads some data from the internet but it needs to be uncompressed or decoded or DEC red or something then actually those files can also go in the cache and again from time to time it can say do I need to go and get a newer version the latest version but when you do refresh the app when you do restart the app it can get a lot of its data directly from the cache rather than having to go out onto the internet to go and get it or using its processing time to actually decode or decrypt the files but what happens sometimes is those cash files get themselves in a might mainly a bug in the program or it hasn't refreshed them when it should have done there's newer ones available on the internet and it hasn't brought them down and what you do by clear cach is you delete all those files now that's perfectly okay because uh Android apps are written in such a way that it knows that files that are in the cache are only temporary and if they're not there it doesn't panic it just goes to the internet again and goes and gets them or it does the processing again to decrypt or decode or whatever it needs to do to those files so it knows that there is a situation when a cash file might not be there so therefore by cleaning the cash what you're actually doing is saying to the app hey you've got nothing here let's start again so by doing a four stop and a clear cache you're restarting the program with some new uh with an empty cache which means it has to start again with new data and hopefully that will fix the program my name is Gary Sims from Android authority I hope you enjoyed this video if you did please do give it a thumbs up I'd like to mention that there is a playlist of all the Gary explains videos on the front page of the Android authority YouTube channel also don't forget to sub subscribe to the Android authority YouTube channel it's also good if you download the app because that will give you access to all our news and features directly on your mobile phone and last but not least do go over to Android authority.com because we are your source for all things Androidhello there my name is Gary Sims from Android authority now if you've ever had a misbehaving app on your smartphone maybe you've looked around the internet you've read some forums and somewhere on the line someone has said to you you should do a for stop and a clear cache that will help your problem so the question before us today what is a four stop what is a cash and why does a four stop and clear cash actually help fix misbehaving apps well let me explain okay at the very heart of Android is the Linux kernel and inside of Linux all programs that run run in a thing called a process and the process is a logical container that allows the kernel to know about which programs are running which memory is allocated to them what priority they have how much C CPU time they need and basically in Android every app that you run actually runs inside of a Linux process now I won't go into much more now about Linux process I've done a whole video on processes and threads that you can find here on the Android authority Channel if you go to the front page of the Android authority Channel you'll see a playlist for all of Gary explains videos and you can easily find it in there now when you start an application it starts a Linux process and it can basically go through some different states now at the Linux level it can go through running runnable and sleeping so in a process is for example actually on the CPU it's running when it's ready to run on the CPU it's runnable and when it's waiting for something to happen like Network traffic it's known as sleeping now Android also has some different states for the activities which make up your app and those activities include running and paused and stopped and basically what happens is is that Linux uh sorry Android can say to an app you are now in the pause state or you're going to be stopped which tells it it's going to kill it off or it's going to have to need to save some of its data it's about to be killed and what's interesting is when Android wants to stop an app it doesn't actually stop the app it just says to Linux kill that process which means that the process gets obliterated out of memory all of the memories freed up it's not given any more CPU time all the files that it had opened are closed any locks that it had open are freed and so on basically when Linux kills off the process everything just disappears which is a great way to ensure that the app has actually just completely gone and just like Android can tell Linux to kill a process you can tell Android to tell Linux to kill a process and that's what force stop does basically you say to Android I want this process to stop and it will obliterate it from memory and it will be definitely gone now the reason why that helps is because if you have a misbehaving app it's got itself into a funny loop it's got itself into a funny condition and it's not recovering then by ding a false stop you're actually killing off the pro and then when you restart it it may very well start back up into a better State and start functioning as it needs be another good thing about four stop is that once the process has been deleted then all the open files have been closed which means we know the files inside the cache directory are now no longer being used so what's the cach directory basically the cache directory is a place where an app can store temporary files for example if when the app starts up it needs to download something from the internet maybe a data feed maybe some images it could just download those things every time it starts up or every time you refresh the display but of course that will take a long time and it will also use up your bandwidth much better to get it periodically and then store the files in the cache and then from time to time the app can say hey should I update these uh files that are in my cache or are they okay at the moment and it would also be true for example if it was doing some processing maybe it downloads some data from the internet but it needs to be uncompressed or decoded or DEC red or something then actually those files can also go in the cache and again from time to time it can say do I need to go and get a newer version the latest version but when you do refresh the app when you do restart the app it can get a lot of its data directly from the cache rather than having to go out onto the internet to go and get it or using its processing time to actually decode or decrypt the files but what happens sometimes is those cash files get themselves in a might mainly a bug in the program or it hasn't refreshed them when it should have done there's newer ones available on the internet and it hasn't brought them down and what you do by clear cach is you delete all those files now that's perfectly okay because uh Android apps are written in such a way that it knows that files that are in the cache are only temporary and if they're not there it doesn't panic it just goes to the internet again and goes and gets them or it does the processing again to decrypt or decode or whatever it needs to do to those files so it knows that there is a situation when a cash file might not be there so therefore by cleaning the cash what you're actually doing is saying to the app hey you've got nothing here let's start again so by doing a four stop and a clear cache you're restarting the program with some new uh with an empty cache which means it has to start again with new data and hopefully that will fix the program my name is Gary Sims from Android authority I hope you enjoyed this video if you did please do give it a thumbs up I'd like to mention that there is a playlist of all the Gary explains videos on the front page of the Android authority YouTube channel also don't forget to sub subscribe to the Android authority YouTube channel it's also good if you download the app because that will give you access to all our news and features directly on your mobile phone and last but not least do go over to Android authority.com because we are your source for all things Android\n"