Since I found so much help in your forum, I wanted to share my solution to reclaim the memory which htc MAIL was hugging.
(1) What my system was
HTC Sensation Z710e
Android 2.3.4
HTC Sense 3.0
Pyramid PVT Ship S-on RL
HBoot-1.18.000
This mobile was sold through Swisscom in Switzerland in the summer of 2011.
I do not have many apps installed.
(2) How it started
I got the occaisonal complaint, that memory was low. Usually I rebooted the system and was fine again. Then one day updates of installed applications started to fail because of low memory. I then discovered that the "Task Manager" had an menue item "Advanced" and the "Storage Use". I then saw that my "Internal Storage" of 1GB was almost full, only a couple of MBs were left. When I sorted "by size" I found "MAIL" ("Mail for Android", Version 4.021173725446.1119931, proudly copyrighted by htc) at the top of the heap using more than 490MB. I found this strage because at the time I was only synching two POP3 accounts and had only two weeks of mail on the device.
The memory usuage even stayed the same after I removed the two accounts from my MAIL app. This really annoyed me.
I searched the htc site for news. Found none. Finally managed to write them a message to ask if somebody could help me. They asked what phone I had and kindly refferd me to the FAQs. Then I started to search the net for information. I found hints that I was not the only one with this problem and that htc had not really been quick in providing a solution. In fact, I found no trace of a solution provided by htc. But more and more evidence that the MAIL app had a "memory leak", i.e. stored data but did not care to remove it after use ...
And the only way to solve this seemd to be to digg very deep, take a walk through the file system, become "super user" with "root" privileges and clean some folders manually.
(3) Getting to the root of the problem
I spend some time to learn what "rooting a device", "S-OFF"ing a htc phone, "recovery" and "DO NOT DO THIS UNLESS YOU WANT TO VOID YOUR WARANTY!!!" meant.
I found
[Anleitungen] Root | S-OFF/S-ON | Custom ROM flashen | Firmware Update/Downgrade - HTC Sensation Root und ROM - Android Forum which is a Swiss-German forum with instructions, warnings, more warnings and an nice FAQ about all the words which I did not yet know. Thanks
FordSierra88 and
timsah! Really helpfull stuff! And thank you XDA, Unrevoked and AplhaRev for the orriginal work which they reference in their posts!
(3.1) Digging deep
Here is what I did:
(1) got the tool from revolutionary (
Revolutionary)
(2) stopped htcSync on my PC
(3) ran the tool and also installed Clockworkmod when the tool asked me to
These steps gave me "S-OFF".
(4) got "Superuser-3.0.6-efgh-signed.zip"
(5) put the zip in the top folder on my sdcard
(6) went to the boot menu by starting the phone with "volume down" pressed
(7) asked "recovery" to "install zip from sdcard" (you need to "toggle signature verification" twice to get "verification dsiabled") and chose to install "Superuser-3.0.6-efgh-signed.zip". I got an error message at the end but the SuperUser-app was still installed ok.
These steps gave me the possibility to obtain "soft root".
(8) I got "Terminal Emulator" from the Android Market
(9) then Android Market suddenly disappeard, but this was just Google "upgrading" it to PlayStore ... but it scared the wits out of me
(10) started the Terminal Emulator which luckily still installed fine after I had made some room by shifting other apps to the sdcard.
(11) typed su in the command window and granted myself root privileges
3.2 Where did I finally find the 490MB?
I did not dare to just "rm -r ./*" in
/data/data/com.htc.android.mail/app_mail as suggested inn the post by
evoVoyager above.
Remembering my old Unix days, I mainly worked with the Terminal Emulator using "ls", "ls -a", "ls -l" and "ls -a -l", "pwd", "cd .." and finally "rm".
/data/data/com.htc.android.mail/app_mail contained a lot of old attachments, many in multiple versions with timestamps some minutes apart: *.pdf, *.jpg, *.JPG, .*.doc, *.xls, winmail*.dat, ... when I removed them using the Terminal Emulator, Mail's storage use dropped from 494MB to 104MB.
/data/data/com.htc.android.mail/databases was good for another 15MB. Before delting them, I used "cat" to moved the databases to "sdcard" and from there to my PC. If I should ever need them again, I know where to find them.
And finally:
/data/data/com.htc.android.mail/app_mail/.data/mail/related and
/data/data/com.htc.android.mail/app_mail/.Mail contained old attachments (again *.gif, *.jpg, "*.png", ...) again some with multiple copies and timestamps. If somebody is interested, I have a list of what some 8000 of these file-names look like. After deleting those files, the memory usage of Mail dropped to around 100KB.
This is were I stopped ...
(4) Closing remarks
As suggested in this forum, I got the K9 email client and hope it keeps track of which files are still needed.
I like the htc products. But I find it unbelievable that htc ships an app which just eats memory as if there was no tomorrow. How can htc ignore this behaviour? I am not an Android wizzard, but finally found the files which used up my memory
without any connection to the data the Mail app was showing. As a reminder: I deleted all the accounts which I managed with MAIL. It may be more diffciult to prevent MAIL from leaving files in memory, but I think other programmers have done it before.
I hate htc a little because they made me S-OFF and ROOT my phone. Ok, sorry, they did not make me, but sending me an email which referred me to the FAQ on their site did not help.
I hope that this account will help others to render their devices in workable conditions again. Please look at the websites I mentionned and get some idea what you are doing. What you don't want to be doing is "brick" your htc. And "to brick something" is one of the concepts that everybody needs to understand before you even start to S-OFF or ROOT.
Thanks again for this incredible usefull forum.
====================
P.S. While I was searching the phone's file system using the Terminal Emulator, I got JAVAsdk, ADB (
What Is ADB And How To Install It With Android SDK) and AndroidCommander (
[TOOL] Android Commander 0.7.9.10 - xda-developers, thanks
PanPjotr!) for my PC. Its shell window is easier on my eyes and I was able to cut and paste commands and output from it to my PC's notepad for future reference. It also helped me to shuffle some of the files but I did not get so far as to get "hard root" to allow Android Commander to work on the system folders ... I was too scared.