Android running out of Memory

One annoying issue on my SGS2 was the fact it kept running out of device space, making app updates fail. Running out of apps to move onto SD or uninstall I wasn’t able to update Facebook anymore, for example.

Sick of this situation, I finally decided to investigate. To cut a long story short, I found what I expected. So let’s start at the beginning. My suspicion since a long time is, it doesn’t clean up some sort of temporary files or log files. To investigate, I’ve installed an ssh server app (phone must have been rooted before!) and the midnight commander installer (paid a dollar).

Logged in from the PC, I figured that device storage is mounted on /data, and as known from using the storage screen somewhere inside the settings app, there’ve only been about 200MB of free space out of 2GB. Too low for certain updates to run through, and near the threshold for annoying memory warnings.

After looking around with mc a bit, I figured it not to be of much use, actually, and went on just using df and du. What I did was basically this:

# cd /data
# du | sort -n

And here we go – about 500MB in /data/log, mainly consisting of crash dumps. I was able to remove those files without any problem and left all other files (about 20MB or something) untouched, because I was too lazy to furtherly investigate what they are good for.

Then, to reduce the size of the directory, I did the following:

# mkdir _log
# chown system.log _log
# chown 775 _log
# mv log/* _log
# mv log __log
# mv _log log

Rebooted phone, and now, everything is fine again.

For the ordinary user, a big mess! No chance without rooting, I guess. You could perhaps do a manufacturer reset and loose all our app installations and data I guess, but what a bad choice. No idea whether this is to blame on google or on Samsung. Anyway I can only consider this a major pain in the lowermost spot of one’s back.

Leave a Reply

Your email address will not be published. Required fields are marked *