Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[mod] How to reduce the threshold for displaying “Low on Space” warnings

OP icecreamisdrugs

18th December 2010, 07:10 AM   |  #1  
icecreamisdrugs's Avatar
OP Junior Member
Flag San Francisco, California
Thanks Meter: 7
 
15 posts
Join Date:Joined: Aug 2010
More
or: How to avoid rejected text message errors with lots of free space available

Background:

This post helped me a bunch and alleviated my issue with lost text messages due to "low space" errors. I'm using cMTD + eFOS [forum.cyanogenmod.com/topic/8711-read-this-recovery-and-installing-cyanogenmod6-firerats-cmtd-ennons-fso-gapps/] + magpie [forum.cyanogenmod.com/topic/9731-magpie-2010-12-07] on my nexus one and my "low space" threshold jumped from ~20mb (stock) up to ~40mb with all the mods. Clearly 40mb is more than enough space for receiving text messages [hell 20mb was more than enough, but I digress...]. Since my internal memory is much, much larger than default (~320mb on /data) I've set my threshold to 2% of the total space available instead of the 5% suggested in the post. At this ratio that drops my "low space" threshold down to ~10mb which is what I would expect it to be at by default.

So if you're having issues and need a real solution that isn't "just remove some of your apps so you have more free space" then try this mod. I would suggest making a copy of settings.db just in case you need to go back to default, but really there isn't much that you could break by doing this. Keep in mind that the number you're changing is a percentage and not a fixed number value, so mileage will vary from device to device. Play with the numbers and see what works best for you. The way I tested it was dropping a bunch of dummy files (actually just multiple copies of an .apk, don't forget to delete these when you're done testing ^_~) into /data/local/tmp until the free space message was displayed, then texted myself using gVoice [voice.google.com] and altered the threshold percentage until I got to a comfortable level.

As a side note, it would be *awesome* if there was an option in the Settings > CyanogenMod Settings menu that let us alter this value through a gui so we don't need adb. I would do it, but I have no confidence in my java programming skills =p *hint hint*

Anywho on to the meat of this post...

---------------------

Low on Space – Phone storage space is getting low.

Its a cursed message on my Android HTC Hero, but there is 16MB free on /data partition! I want my email to sync a bit more and I want to receive text messages and I dont want to delete any apps.

You need to have rooted your android device and have the android sdk installed and debugging enabled on your phone. I might package this recipe up into an apk for easy installation.

The default limit is 10% of free space, i’ve reduced mine to 5%, I don’t know if there are any terrible side effects. As you’ve already rooted your phone you’ve already probably voided your warranty

To reduce from 10% to 5% warning from your “adb shell”:

Code:
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
sqlite> insert into secure (name, value) VALUES('sys_storage_threshold_percentage','5');
sqlite> insert into gservices (name, value) VALUES('sys_storage_threshold_percentage','5');
sqlite> .quit
# reboot
*** don't include the # or sqlite>, those are the console prompts... ***

Some firmwares seem to look for the setting in gservices but the latest android source looks like it looks for it in the secure settings, so i’ve included both for good measure.


---------------------

Note:

reposted (with a few edits) from [bryars.eu/2010/10/how-to-reduce-the-threshold-for-low-on-space-android-warnings/]


Disclaimer:

This is not my work / information / blog, but since it was a huge help to me and I couldn't find the information anywhere else I thought I'd post it here for others to use ^^


Additional information:

If you want more information or a gui to edit the settings.db file, use adb to pull the file from /data/data/com.android.providers.settings/databases/settings.db, edit settings.db using a program like SQlite db browser [blog.dreamcss.com/dev-tools/sqlite-database-browser/], then push the file back to the phone using adb and reboot.
The Following 4 Users Say Thank You to icecreamisdrugs For This Useful Post: [ View ]
5th September 2011, 03:17 PM   |  #2  
Senior Member
Flag London
Thanks Meter: 46
 
256 posts
Join Date:Joined: Sep 2008
More
Sorry for reviving an old thread but this is an excellent find, especially on my S-Off Desire when the phone complains about the lack of space at 30 MB!
22nd May 2012, 08:16 PM   |  #3  
Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Jun 2008
Apps won't install or update, insufficient storage, 200MB free
Same here, sorry for reviving the thread, maybe I should have started a new one, but this topic has half the answer... this works perfect to stop the notification, but...

I still get the "Insufficient storage available." notification when I try to update or install an app.

I've looked around and searched here and on Google

I have the Galaxy S2 Skyrocket, with 2GB for /data, so it still has 200MB free. I know I've gone app crazy with over 200 apps installed, but that's not the point. I plan to organize and thin them out once I get some time to see which ones I want to stick with, but since there is plenty of space left, that shouldn't be a problem.

This is not related to the other issues I found on the forum (like this one or this one), and I know I can gain some space back by clearing caches and obviously by removing some apps or getting an sd card and moving apps to it. That's not the correct solution, those are all just workarounds.

Any ideas? Based on this topic, it would make sense that there is another key I can add to the database somewhere to lower the same threshold but for installing/updating apps.
24th May 2012, 05:45 PM   |  #4  
Member
Thanks Meter: 11
 
37 posts
Join Date:Joined: Nov 2007
More
@WebGuru, I am also interested in finding a way to lower the point at which my device start telling me insufficient storage. My S-OFF HTC Desire with custom HBOOT has 387MB /data and therefore I get insufficient storage prompts when I have ~35MB of space remaining. Most annoying. I've applied the DB update and I confirm it silences the notification only.

If I find anything useful I'll post it here.

Regards, Martin.
28th May 2012, 02:08 AM   |  #5  
icecreamisdrugs's Avatar
OP Junior Member
Flag San Francisco, California
Thanks Meter: 7
 
15 posts
Join Date:Joined: Aug 2010
More
From what I understand the problem with app installs is due to the free space threshold value being hard coded into some aspect of the ROM itself and therefore no DB value exists nor can be created which will allow for adjustments. The issue would have to be taken into account by the ROM developer or by someone willing to hunt down the values and create a custom build with the appropriate fix.
Post Reply Subscribe to Thread

Tags
android, free space threshold, mod, rejected text messages, warnings
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes