1. Download our Official Android App: Forums for Android!

Root App2sd part of app still occupy internal storage

Discussion in 'Android Devices' started by chuanjie, Apr 5, 2011.

  1. chuanjie

    chuanjie Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    12
    Joined:
    Apr 5, 2011

    Apr 5, 2011
    12
    0
    15
    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?
     

    Advertisement

  2. SUroot

    SUroot Android Expert
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,306
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    Did you move dalvik cache to sd?
     
  3. chuanjie

    chuanjie Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    12
    Joined:
    Apr 5, 2011

    Apr 5, 2011
    12
    0
    15
    yes, it's on SD, currently im having ~90mb free of internal storage so I'm not that bothered just a little bit confused.
     
  4. SUroot

    SUroot Android Expert
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,306
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    All I know is it happens like this for some. Not sure why. I move angry birds to sd and regain no space
     
  5. Usta

    Usta Android Expert
    Rank:
    None
    Points:
    333
    Posts:
    2,585
    Joined:
    Jul 8, 2010

    Jul 8, 2010
    2,585
    1,375
    333
    The Netherlands
    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.
     
  6. SUroot

    SUroot Android Expert
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,306
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    I'm wondering if Gingerbread works differently to Froyo with move to SD, cause I have seen a few people this happens to, and all on GB roms.
     
  7. JohnnyBravo1000

    JohnnyBravo1000 Android Expert
    Rank:
    None
    Points:
    78
    Posts:
    929
    Joined:
    Jun 3, 2010

    Jun 3, 2010
    929
    56
    78
    Luton
    Re: Angry Birds.

    I think it's programmed to move the app (or part of it) to the SD card.

    I am currently running LeeDroid 2.3d A2SD and whenever I download the latest update for Angry Birds it shows up on my SD card. I just move it back to my phone - obviously meaning it will move back to the partition on my SD card.
     
  8. SUroot

    SUroot Android Expert
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,306
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    Yes its coded to go straight to sd
     
  9. Hadron

    Hadron  
    VIP Member
    Rank:
     #8
    Points:
    2,218
    Posts:
    20,775
    Joined:
    Aug 9, 2010

    Aug 9, 2010
    20,775
    13,827
    2,218
    Spacecorp Test Pilot
    Dimension Jumping
    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?
     
    SUroot and Usta like this.
  10. Hadron

    Hadron  
    VIP Member
    Rank:
     #8
    Points:
    2,218
    Posts:
    20,775
    Joined:
    Aug 9, 2010

    Aug 9, 2010
    20,775
    13,827
    2,218
    Spacecorp Test Pilot
    Dimension Jumping
    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 ;)
     
    SUroot likes this.
  11. Usta

    Usta Android Expert
    Rank:
    None
    Points:
    333
    Posts:
    2,585
    Joined:
    Jul 8, 2010

    Jul 8, 2010
    2,585
    1,375
    333
    The Netherlands
    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...
     
  12. SUroot

    SUroot Android Expert
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,306
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    We could maybe move the directories to ext and create a link via a script
     
  13. Usta

    Usta Android Expert
    Rank:
    None
    Points:
    333
    Posts:
    2,585
    Joined:
    Jul 8, 2010

    Jul 8, 2010
    2,585
    1,375
    333
    The Netherlands
    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?
     
  14. SUroot

    SUroot Android Expert
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,306
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    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?
     
  15. Hadron

    Hadron  
    VIP Member
    Rank:
     #8
    Points:
    2,218
    Posts:
    20,775
    Joined:
    Aug 9, 2010

    Aug 9, 2010
    20,775
    13,827
    2,218
    Spacecorp Test Pilot
    Dimension Jumping
    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.
     
  16. SUroot

    SUroot Android Expert
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,306
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    Yes agree. Would be nice if a2sd+ could catch up with this new trick though.

    Maybe something for Dark Tremor to look into?
     
  17. Usta

    Usta Android Expert
    Rank:
    None
    Points:
    333
    Posts:
    2,585
    Joined:
    Jul 8, 2010

    Jul 8, 2010
    2,585
    1,375
    333
    The Netherlands
    Here is another "bad boy" - Summer Player. Moving it to SD card frees up a good 10MB internal space...
     
  18. Hadron

    Hadron  
    VIP Member
    Rank:
     #8
    Points:
    2,218
    Posts:
    20,775
    Joined:
    Aug 9, 2010

    Aug 9, 2010
    20,775
    13,827
    2,218
    Spacecorp Test Pilot
    Dimension Jumping
    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.
     
  19. SUroot

    SUroot Android Expert
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,306
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    Actually, I already knew that, not sure why I thought I didnt :rolleyes:

    I even posted in regards to that functionality in the DT thread :eek:
     
  20. Usta

    Usta Android Expert
    Rank:
    None
    Points:
    333
    Posts:
    2,585
    Joined:
    Jul 8, 2010

    Jul 8, 2010
    2,585
    1,375
    333
    The Netherlands
    LOL, you are getting older... :D
     
  21. chuanjie

    chuanjie Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    12
    Joined:
    Apr 5, 2011

    Apr 5, 2011
    12
    0
    15
    The baddest of them....Skype, no matter how you move it, it's taking ~7/8mb of your internal storage, uninstalled
     
  22. Usta

    Usta Android Expert
    Rank:
    None
    Points:
    333
    Posts:
    2,585
    Joined:
    Jul 8, 2010

    Jul 8, 2010
    2,585
    1,375
    333
    The Netherlands
    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. :)
     
    shauny13 and SUroot like this.
  23. 1500cc

    1500cc Well-Known Member
    Rank:
    None
    Points:
    16
    Posts:
    95
    Joined:
    Sep 12, 2010

    Sep 12, 2010
    95
    4
    16
    Does that app essentially replace the APP2SD+ routine that some custom ROMs have? I'm rooted, but a stock ROM, so it would be nice to create an EXT partition and not have to worry about app space anymore, yet not have to flash a custom ROM.
     
  24. SUroot

    SUroot Android Expert
    Rank:
    None
    Points:
    1,123
    Posts:
    23,925
    Joined:
    May 25, 2010

    May 25, 2010
    23,925
    5,306
    1,123
    UK Technical Lead; Desktop Support
    Riddlesden, West Yorkshire, UK
    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
     
  25. 1500cc

    1500cc Well-Known Member
    Rank:
    None
    Points:
    16
    Posts:
    95
    Joined:
    Sep 12, 2010

    Sep 12, 2010
    95
    4
    16
    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.
     
Tags:

Share This Page

Loading...