• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root App2sd part of app still occupy internal storage

chuanjie

Newbie
Apr 5, 2011
12
0
Hi, first of all i would like to thank all the great members in this forum, i have learned a lot and finally rooted my phone with gingervillain 1.8. Really like it so far.

Now back to question, I know I'm not supposed to use 'move to sd' option since I'm using app2sd (I'm sure it is activated since most of the apps are installed on the app2sd partition), but I notice for some app part of the internal storage are still used, and I am sure it's not data or cache.

Take angry birds for example, total size is ~20mb and once installed few mb of my internal storage will be used by the app and once i move the app to SD i regain the space. Some apps can be totally fit into app2sd partition. Can anyone explain to me why is this happening?

Also, what problem am i going to encounter by doing moving those stubborn app to SD, other than they can't be used when SD is mounted?
 
I start to experience similar issue.
I've installed some more apps from Market and suddenly saw some of them sitting on SD card. Of course I've moved them back to phone memory and boom - I've lost some 25MB in the process. Suspecting Dalvik cache script not working, I've run it again. After the phone reboot, I still see the low memory (about 50MB) in my case. Now, if I move something from phone to SD card, if frees up some space (Angry birds makes just 2MB difference for me, but Aldiko 8MB, etc...). Strange.
 
Upvote 0
Apologies: this post could be a bit long and may get a touch techie.

I decided to dig a little further, so attached my phone to my laptop and used "adb shell" to see what moved when I shifted Aldiko between SD and phone. The main commands I used were "ls -l" (list files, long output) and "du -hs" (disk usage, human readable, summary output), both basic unix/linux commands. You could use terminal emulator too, but adb was more convenient.

Firstly, as Usta reports, moving Aldiko changes internal storage by 8MB on my phone.
The difference is easy to locate. With Aldiko on SD I see

$ adb shell du -hs /data/*/*aldiko*
627.0K /data/dalvik-cache/mnt@asec@com.aldiko.android-1@pkg.apk@classes.dex
2.0M /data/data/com.aldiko.android

and looking inside the directory /data/data/com.aldiko.android I find:

$ adb shell ls -l /data/data/com.aldiko.android
lrwxrwxrwx system system 2011-04-06 18:48 lib -> /mnt/asec/com.aldiko.android-1/lib
drwxrwx--x app_149 app_149 2011-04-01 21:25 shared_prefs
drwxrwx--x app_149 app_149 2011-04-01 21:25 cache
drwxrwx--x app_149 app_149 2011-04-01 21:25 databases
drwxrwx--x app_149 app_149 2011-04-01 21:25 app_admob_cache
drwxrwx--x app_149 app_149 2011-04-01 21:26 files

The important line is the first one: the lib directory is actually a link to /mnt/asec/com.aldiko.android-1/lib. If I do the same with Aldiko on the phone, I see instead:

$ adb shell du -hs /data/*/*aldiko*
5.2M /data/app/com.aldiko.android-1.apk
627.0K /data/dalvik-cache/data@app@com.aldiko.android-1.apk@classes.dex
10.3M /data/data/com.aldiko.android

where /data/app is a link to /sd-ext/app, so the apk is actually on the ext partition as expected. But looking in /data/data we see:

$ adb shell ls -l /data/data/com.aldiko.android
drwxr-xr-x system system 2011-04-06 18:53 lib
drwxrwx--x app_149 app_149 2011-04-01 21:25 shared_prefs
drwxrwx--x app_149 app_149 2011-04-01 21:25 cache
drwxrwx--x app_149 app_149 2011-04-01 21:25 databases
drwxrwx--x app_149 app_149 2011-04-01 21:25 app_admob_cache
drwxrwx--x app_149 app_149 2011-04-01 21:26 files

where lib is no longer a link, but a directory physically within /data/data/com.aldiko.android. And you guessed it, it contains an 8.2 MB shared object library, and that's what makes the difference to internal storage when moving this app between SD and phone.

If I pick a "well behaved" app like DocsToGo (big, but moving it has no effect on internal storage) I find that /data/data/com.dataviz.docstogo/lib is empty. The corresponding directories for Angry Birds and Flash Player contain 1.7 MB and 7.8 MB shared object files respectively, both matching the change in internal storage when they are moved.

So, I think I know what's happening with GingerVillain: the non-root "move to SD" moves the app's lib directory to the sd. For many apps this is empty or contains a very small file, but there are exceptions.

Questions: what is different with Froyo? And what is different for people who don't see this effect?

I suppose I could restore one of my old DeFroST nandroids and see if Froyo behaves differently. But could someone for whom moving Angry Birds on GV doesn't affect internal storage try the following: either via adb shell as above, or using a terminal emulator, type the command "ls -l /data/data/com.rovio.angrybirds" and tell us what it says about the "lib" directory? And maybe move it between phone and sd and see if this changes?
 
  • Like
Reactions: SUroot and Usta
Upvote 0
OK, I've done the Froyo experiment - quite nostalgic running DeFroST again :)

Anyway, I can confirm that with DF moving Aldiko between phone and SD doesn't move the app's lib directory. So that seems to explain the different behaviour between 2.2 and 2.3 - 2.3's "move to phone" does indeed move part of the app which wasn't moved by 2.2.

Currently restoring GV - nostalgia only goes so far ;)
 
  • Like
Reactions: SUroot
Upvote 0
Very comprehensive analysis Hadron, Thank You!
I've run the Terminal Emulator and my findings were the same as yours. I've got most of the difference by installing "heavy" apps like video players. These are recommended to keep on phone memory for the best performance. I suspect these programs have a large lib directory.

Looks like there is not much we can do at this moment. At least we know that DT script is still working in GV, and that the apps behavior is different depending on their programming.
I start feeling the pressure to move to a data2ext solution...
 
Upvote 0
OK... I don't know about the script part, but wouldn't moving the directories brake some share tasks or the market links?
I assume the moving can be done by adb shell or root explorer?

Well if the the app and the lib are in the same directory on NAND and on the same directory on SD, but not changed when on EXT, I dont see why it can't be both on EXT or SD?
 
Upvote 0
I thought about this. It should work, but unless you relocate /data/data en masse (a data2sd type approach) it means moving and linking subdirectories for each app. Would be possible to write a script to do it, but would need to be re-run when new apps added. Not a problem for the android solution as they either do it during installation or when you ask for an app to be moved, either way app-by-app, but harder for a third party to automate without going deeper than certainly I have so far.

Of course what this means is that the apps2sd+ is working as well in GB as it did in Froyo, just that the android version has gained an extra trick. It would be nice to have the best of both, but we've not lost anything here.
 
Upvote 0
Maybe something for Dark Tremor to look into?
I think they are, though not just /data/data/<app>/lib. The DarkTremor changelog includes the following for version 2.7.5.3 (currently in beta 04):

"Added experimental support for moving the /data/data directory to the SD card. "

Guess Richard won't be including this while it's still experimental though.
 
Upvote 0
I found an easier way to verify what is being moved and how much.
Get the Link2SD app from Market (root users only) and it will show you (among other things) the following info:

* APK size - this is what can be moved to ext partition
* Dex size - size of the Dalvik cache that can be moved to ext optionally
* App size - the total space needed for the app
* Data size - User data
* Cache size - app cache that can be easily wiped

The important part is comparing the App size with the Apk size (App Data is not relevant, because it is getting moved anyway). Since I have a DT script, Dex is also being moved.

For example, we have noticed earlier that Angry Birds moves "well" to ext. I see in the game details the folloing:
App (18.4MB) - Apk (16.7MB) - Dex (0MB) = Lib that remains behind (1.7MB)

Now, let's look at Aldiko:
App (14MB) - Apk (5.1MB) - Dex (0.6MB)= Lib that remains behind (8.3MB).

And the Skype:
App (8.4MB) - Apk (7.4MB) - Dex (0.8MB) = Lib that remains behind (0.2MB) (not bad at all!!!).

Finally the Summer player that I was complaining about:
App (16.5MB) - Apk (6.1MB) - Dex (0.6MB) = Lib that remains behind (9.8MB). Now this app was made to work against the a2sd script...


Bottom line, now I know exactly the impact each app will have on my internal storage. :)
 
  • Like
Reactions: shauny13 and SUroot
Upvote 0
You can put a2sd on a rooted stock by enabling init.d linked in my rooting faq.

Why not flash a custom Rom though? They're.much more efficient than stock

I looked at the init.d thing, but my software version is 2.09.405.8, which according to the instructions isn't supported.

I'll probably do a custom ROM at some point, but if I do it, I'd like to do Gingerbread. However I like Sense and AFAIK there aren't any 2.3 Sense ROMs out yet.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones