Skip to content
This repository has been archived by the owner on May 20, 2019. It is now read-only.

Version 2.2.0 not cleaning caches #30

Closed
Gitoffthelawn opened this issue Nov 5, 2015 · 21 comments
Closed

Version 2.2.0 not cleaning caches #30

Gitoffthelawn opened this issue Nov 5, 2015 · 21 comments
Labels

Comments

@Gitoffthelawn
Copy link

Versions prior to v2.2.0 have always worked flawlessly. :-)

Version 2.2.0 is not working.

It displays a Cache cleaned toast, but the cache is not cleaned. Unlike previous versions, the cumulative size of the caches that has been deleted is not reported.

Experimenting with all the settings checkboxes did not yield a different result.

Version 2.2.0 tested on Android KitKat.

@lubo
Copy link
Member

lubo commented Nov 5, 2015

Hello @Gitoffthelawn.

The app no longer reports the total amount of cache cleaned because of multiple reasons. First, the number did not use to be accurate, which renders it useless. Second, due to an optimization that allows you to skip scanning before cleaning, the number may not even be available.

Does the actual cleaning work for you ? If not, please, write your device, Android version, ROM and of course, post the logcat output.

@Gitoffthelawn
Copy link
Author

@Kuci Thanks for the details regarding the total amount cleaned.

I will triple-check, but I'm quite sure that nothing is being cleaned.

Since v2.2.0 was just released, let's give it a few days to see if others are also having the issue. The test was conducted on a stock Android 4.4.2 (SDK 19) LG ROM.

@lubo
Copy link
Member

lubo commented Nov 6, 2015

@Gitoffthelawn Why are you quite sure that nothing is being cleaned ? Do you have any numbers ? Any cases of failure ?

@Gitoffthelawn
Copy link
Author

@Kuci When I would run the previous version, it would seem to work. I would then run it again, and the sizes of all the caches would be zero within the app, showing that it was most likely working correctly. To test it, I would go into the stock Android apps manager, and it would show all the caches at zero (except for ones for active processes that quickly get recreated).

When I run the current version, it seems to work as well. No errors. But when I run it again, it shows most of the caches have not been deleted. Going in to the stock Android apps manager confirms this observation.

The first few times I tested the latest version, it did not appear to delete any caches at all. I've had a moment to try it again, and it appears it is deleting some, but not all, caches. Is there a new limit to not delete caches under a certain size?

I was thinking about your comment regarding the size of the caches cleared not being accurate within the app... from what I can see, the cache sizes reported in the app match those reported by the stock Android apps manager. Is it that those values are correct, but the amount cleared was not? If so, why the discrepancy?

@lubo
Copy link
Member

lubo commented Nov 6, 2015

@Gitoffthelawn The only thing we can do about internal cache is to tell Android to free some space, but can not predict how much space will actually be freed.

This line might be buggy on your ROM. I will try to work it around tomorrow and provide you with a branch containing potential fix, so that you could test it out.

@Gitoffthelawn
Copy link
Author

@Kuci No rush at all. :-) I'm busier than I prefer and not sure when I will have time for testing.

Just to clarify and to make sure I'm not misunderstanding, the function of this app is to only clean the internal app caches within the limits of Android (nothing more and nothing less), correct?

In other words, it should be the exact same as pressing Clear Cache for each app in the stock Android apps manager, right?

IIRC, the previous version of this app would reduce cache sizes of all apps to zero. Caches for active processes quickly get recreated, but those are a minority. This new version does not seem to touch most (perhaps any) caches under 100KB and sometimes misses larger ones. I suppose I could have just thought the previous version was working, but I'm pretty sure I double-checked the results via the stock Android apps manager. I was not keeping a written record, however.

I gave Power Clean and CCleaner a try to see how they compare to this project. Power Clean finds and deletes app caches of all sizes. CCleaner seems to find and delete app caches over a certain threshold, perhaps 32KB (the smallest it found was 44KB). I don't know why CCleaner ignores smaller caches.

Here is a quick comparison of the app caches they found in one test:

- Power Clean:   20.4 MB   
- Cache Cleaner: 20 MB   
- CCleaner:      16.11 MB

@lubo
Copy link
Member

lubo commented Nov 7, 2015

@Gitoffthelawn No, it does not do the exact same thing that Clear Cache button in Settings does. Settings app uses API that allows it to immediately delete a cache. We can not use the same API because a permission required to use that API is not available to 3rd party apps in any version of Android. Cache Cleaner uses another API which tells Android how much space in internal storage we would like to be freed and it tries to free as much as we ask for. It is not as reliable as the button in Settings app, yet I find it very reliable on all the devices I have been testing Cache Cleaner on.

Therefore, it is not up to Cache Cleaner what is being cleared, it is up to Android and we can do pretty much nothing about it.

@Gitoffthelawn
Copy link
Author

@Kuci That's a fantastic (and very well written) explanation. Thank you!!!

What happens if you just always tell the API that you want a large value to be freed (64GB, for example)?

I also found Cache Cleaner to be very reliable. When I started using it, it seemed to be just as effective as pressing the Clear Cache button in the stock Android apps manager (although much faster when there are hundreds of apps!).

Any ideas what Power Clean and CCleaner are doing? I will have to double-check, but I think they both list the cache sizes for specific apps. That makes me think they are somehow clearing specific app caches (or at least making it look like they are). I have a hunch (and it's just a guess) that CCleaner uses the same technique as Cache Cleaner, but Power Clean might be using another technique.

@lubo
Copy link
Member

lubo commented Nov 7, 2015

@Gitoffthelawn Then Android will try to free 64GB of internal storage. Cache Cleaner tells Android to free as much as is the size of data partition. In other words, data partition on my Nexus 5 is 12.6 GiB, so Cache Cleaner tells Android to free 12.6 GiB of internal storage.

Both Power Clean and CCleaner use the same permission that Cache Cleaner uses, so both of them must be using the same API that we do.

lubo added a commit that referenced this issue Nov 7, 2015
@lubo
Copy link
Member

lubo commented Nov 7, 2015

@Gitoffthelawn I have created issue-30 branch. Please, try it yourself if you can and report the results.

lubo added a commit that referenced this issue Nov 7, 2015
@Gitoffthelawn
Copy link
Author

@Kuci Thanks. It's on my list. Will be quite some time, but it's in the queue.

I have a few more questions / ideas, and will hopefully have time to post again soon.

In the meantime, quick question: Can you think of any changes in the latest version that would cause this issue (besides the one for the test build)?

@lubo
Copy link
Member

lubo commented Nov 7, 2015

@Gitoffthelawn e54a76c is the only commit between v2.1.6 and v2.2.0 in which I have made changes to the code related to internal cache cleaning, so no.

@lubo
Copy link
Member

lubo commented Nov 20, 2015

@Gitoffthelawn This issue has been opened for over 2 weeks now, are you having troubles with testing ? Do you want me to compile it for you ?

@Gitoffthelawn
Copy link
Author

My apologies... I've been overbooked. I've also been thinking about an effective methodology to test it and compare it's results to other tools. Do you have any ideas?

If you can compile it, that would be great.

lubo added a commit that referenced this issue Nov 21, 2015
@lubo
Copy link
Member

lubo commented Nov 21, 2015

Here it is, I have compiled it for you. Just replace .txt with .apk and install it on your device. Let me know about the results.

CacheCleaner-debug.txt

@lubo
Copy link
Member

lubo commented Nov 28, 2015

@Gitoffthelawn It has been a week since I posted the APK, what is the result of testing ?

@Gitoffthelawn
Copy link
Author

@Kuci What do you think is an effective methodology to test it?

@Gitoffthelawn
Copy link
Author

@Kuci I'll have a test system available for about 20 more minutes if you have a good idea on how to test it effectively.

@Gitoffthelawn
Copy link
Author

@Kuci I completed the testing. Here are the results.

Test operating system: Android KitKat v4.4.2

Step 1: Opened Cache Cleaner v2.2.0 (public release)
Used: 3.1GB
Cache: 102MB
Free: 743MB

Step 2: Cleaned cache with Cache Cleaner v2.2.0

Step 3: Rescan
Used: 3.1MB
Cache: 4.6MB
Free: 838MB

Step 4: Cleaned cache with Cache Cleaner v2.2.0

Step 5: Rescan
Used: 3.1MB
Cache: 4.6MB
Free: 838MB

Step 6: Cleaned cache with Cache Cleaner v2.2.0

Step 7: Rescan
Used: 3.1MB
Cache: 4.6MB
Free: 838MB
Noticed that many caches still exist, with maximum cache sizes of 76KB

Step 8: Uninstalled Cache Cleaner v2.2.0

Step 9: Installed Cache Cleaner v2.2.0.9-g5963eee (test version)

Step 10: Opened Cache Cleaner v2.2.0.9-g5963eee
Used: 3.1GB
Cache: 4.8MB
Free: 836MB

Step 11: Cleaned cache with Cache Cleaner v2.2.0.9-g5963eee

Step 12: Rescan
Used: 3.1GB
Cache: 4.6MB
Free: 836MB
Noticed that many caches still exist, with maximum cache sizes of 76KB (appear to be same apps as in Step 7)

Step 13: Cleaned cache with Cache Cleaner v2.2.0.9-g5963eee

Step 14: Rescan
Used: 3.1GB
Cache: 4.6MB
Free: 836MB
Noticed that many caches still exist, with maximum cache sizes of 76KB (appear to be same apps as in Step 7)

Step 15: Cleaned cache with Cache Cleaner v2.2.0.9-g5963eee

Step 16: Rescan
Used: 3.1GB
Cache: 4.6MB
Free: 836MB
Noticed that many caches still exist, with maximum cache sizes of 76KB (appear to be same apps as in Step 7)

Step 17: Opened CCleaner v1.11.43. It reported 14.08MB can be cleaned, but there was no specific option for system cache, so did not clean.

Step 18. Opened PowerClean v2.7.10. It reported System Cache 4.75MB

Step 19. Clean System Cache (and only System Cache) using PowerClean

Step 20: Opened Cache Cleaner v2.2.0.9-g5963eee
Used: 3.1GB
Cache: 4.6MB
Free: 835MB

Step 21: Cleaned cache with Cache Cleaner v2.2.0.9-g5963eee

Step 22: Rescan
Used: 3.1GB
Cache: 4.6MB
Free: 835MB

Step 23: In Cache Cleaner v2.2.0.9-g5963eee, clicked on first 3 apps with 76KB caches (each), and manually cleared them using Android UI

Step 24: Rescan
Used: 3.1GB
Cache: 4.4MB
Free: 835MB

Step 25: In Cache Cleaner v2.2.0.9-g5963eee, clicked on next 7 apps with 76KB caches (each), and manually cleared them using stock Android UI
Used: 3.1GB
Cache: 3.9MB
Free: 835MB

Conclusion: Cache Cleaner v2.2.0.9-g5963eee is no more effective than v2.2.0. Stock Android App Manager can clean caches that Cache Cleaner v2.2.0.9-g5963eee and v2.2.0 cannot. Although it is more effective than Cache Cleaner, it is significantly more tedious and time consuming to use the Android App Manager.

@lubo
Copy link
Member

lubo commented Nov 29, 2015

@Gitoffthelawn I am sorry for not replying, I was not on the internet.

Your testing methodology looks good and so do the results. v2.2.0 seems to be working properly because there is always some insignificant cache size, which is somehow locked by Android and we can do pretty much nothing about it.

Thank you for reporting and testing.

@lubo lubo added the invalid label Nov 29, 2015
@lubo lubo closed this as completed Nov 29, 2015
@Gitoffthelawn
Copy link
Author

@Kuci You're welcome. Glad to help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants