+ Reply to Thread
Page 1 of 12 12311 ... LastLast
Results 1 to 10 of 113
Like Tree2Likes

Thread: Relocate dalvik-cache to free up space

  1. #1
    Member equk is on a distinguished road
    Join Date
    May 2010
    Location
    UK
    Posts
    47

    Default Relocate dalvik-cache to free up space

    I stumbled across this after running out of disk space on my i5700,
    re thread: notification - running low on disk space

    original guide: Dalvik-cache-relocation - CyanogenMod Wiki

    I have made a mod file to make it easier for people to install.

    Theory/idea:

    On looking into the problem it seemed dalvik-cache was taking up 45mb of space on the /data partition of the phone & because of the way the filesystem is partitioned there was a 80mb partition reserved for /cache.
    Code:
    df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    tmpfs                    82624        12     82612   0% /dev
    tmpfs                     4096         0      4096   0% /sqlite_stmt_journals
    /dev/stl6               200996    133660     67336  66% /system
    /dev/stl5               150644    150184       460 100% /data
    /dev/stl7                80576      4180     76396   5% /cache
    /dev/stl10                7729       776      6953  10% /efs
    /dev/bml8                 4096      4096         0 100% /xbin
    I thought why can't we move/repoint dalvik-cache to this nearly empty partition?
    I had already heard that people had used SDCards for this but I think that is pretty pointless as SDCards are slow and should be classed as removable storage (ie - you should be able to boot without them)
    On searching around I found someone had actually done this before without any problems.

    The script makes the system put dalvik cache into the /cache partition which is 80mb and gets used by various processes for caching & OTA updates (prob don't have those anymore anyway)

    ** I have now added removal of system dumps to the script to free more space on /data **
    (please read down for more info)

    Basics on the filesystem layout:
    (512mb is divided into partitions)
    /dev 82mb
    /system 200mb
    /data 150mb
    /cache 80mb

    my filesystem after applying this:
    Code:
    Filesystem                Size      Used Available Use% Mounted on
    tmpfs                    80.7M     12.0K     80.7M   0% /dev
    tmpfs                     4.0M         0      4.0M   0% /sqlite_stmt_journals
    /dev/stl6               196.4M    167.5M     28.9M  85% /system
    /dev/stl5               147.1M     73.4M     73.7M  50% /data
    /dev/stl7                78.7M     26.6M     52.1M  34% /cache
    /dev/stl10                7.5M    777.0K      6.8M  10% /efs
    /dev/bml8                 4.0M      4.0M         0 100% /xbin
    /dev/stl7                78.7M     26.6M     52.1M  34% /data/dalvik-cache
    /dev/block//vold/179:1    7.4G    781.4M      6.6G  10% /sdcard
    Note: as with other thread - Dalvik doesn't touch the SDCard with this method

    if you already have a userinit.sh do not use this, you will need to manually edit
    also do not use with Apps2SD (should be no need to use Apps2SD)

    /cache filesystem examples (for comparison):
    Code:
    htc dream
    Code:
    Filesystem                Size      Used Available Use% Mounted on
    /dev/block/mtdblock3     90.0M     89.5M    560.0K  99% /system
    /dev/block/mtdblock5     89.8M     48.4M     41.4M  54% /data
    /dev/block/mtdblock4     30.0M      1.2M     28.8M   4% /cache
     
    tmobile pulse (Huawei U8220)
    Filesystem Size Used Available Use% Mounted on
    /dev/block/mtdblock1 110.0M 100.4M 9.6M 91% /system
    /dev/block/mtdblock2 80.3M 72.3M 8.0M 90% /data
    /dev/block/mtdblock3 20.0M 7.9M 12.1M 40% /cache
     
    htc desire
    Filesystem Size Used Available Use% Mounted
    /dev/block/mtdblock3 250.0M 221.8M 28.2M 89% /system
    /dev/block/mtdblock5 147.6M 69.2M 78.4M 47% /data
    /dev/block/mtdblock4 40.0M 2.6M 37.4M 7% /cache
    also as with most stuff, small disclaimer

    WARNING: THIS METHOD CAN BE DANGEROUS. DO NOT TRY IF YOU DO NOT KNOW WHAT YOU ARE DOING.
    I CAN'T BE RESPONSIBLE IF YOU BRICK YOUR PHONE.

    Note:
    People who have problems with slowdowns when /cache is below 13mb of free space may be having problems due to JIT or custom kernels
    Quote Originally Posted by qstars View Post
    Applied this mod and was happy with all the extra space. So when on a happy installing spree & recently my phone has started to become sluggish. A quick look indicated that only had 12.5 Mb free on dalvik cache... Here's a listing of files according to the code equk posted above...
    Quote Originally Posted by qstars View Post
    @ kenshin

    Unfortunately the phone was sluggish so have already have tried out some other solutions. What I did was tried out equk's mini mod. Interestingly enough, with the remaining free space still at about 12mb or so in the cache partition, the phone was no longer sluggish again.

    This suggests likely that it was the kernel which was causing the problems. Remember that had a linpack score of about 8Mflops or so & was running some JIT kernel (from kitchen the one with opengl drivers as well). After flashing equk mini mod had a linpack score of about 4 -5 mflop... && phone was running well again with the same 12mb or so free space.

    As of now... am trying out apps2sd.

    Btw thanks equk for your spica tips !
    Changelog:
    v1 - 05 June 2010 : script reloactes dalvik to /cache
    v1.1 - 06 June 2010: added removal of system crash dumps

    [Discussion/Feedback/Bug reports] Relocate dalvik-cache to free up space
    Attached Files
    Last edited by H3LLBOY911; 10-04-2010 at 10:31 PM. Reason: added notes relating to low free space and slowdowns, possible cause is JIT
    norman and dangper like this.
    Phone: Samsung Galaxy i5700
    SOC: SGM Nextgen (Froyo)
    Me: github // relocate dalvik to /cache

  2. #2
    Administrator LeshaK is on a distinguished road
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,712

    Default

    Great! Thanks!
    Twitter | Devices: Samsung Spica i5700 - SamdroidMod 2.0.1 Froyo | Nexus One - Android 2.2 Froyo | Nexus S CyanogenMod 7.1
    If you like my stuff, buy me a beer!

  3. #3
    Moderator munchy_cool is on a distinguished road
    Join Date
    May 2010
    Location
    h3LL
    Posts
    3,486

    Default

    ok so am on samdroid and have already checked "move dalvik cache to sd" in samdroid tools, does that mean i cannot use the above method?

    also if i need to how do i go about it.

  4. #4
    Member equk is on a distinguished road
    Join Date
    May 2010
    Location
    UK
    Posts
    47

    Default

    I'm just looking into the memory problem and have found another thing which is causing /data to fill rapidly.
    Possibly related to JIT.

    There are dumps made by the debugger on crashes. These just seem to mount up and use up memory.
    On doing some research it seems there was a fix for this included in one of the custom 1.5 kernels for the Samsung Moment.

    I'm just looking into adding this to the script so it removes these files on startup as I doubt they are much use unless people are actively using them for debugging.

    Currently my phone has 65.7mb used by this.
    Code:
    65.7M   /data/tombstones
    Not sure if this should be added to the kernel or not but I am just testing a new version of this script to remove the files on startup.

    before using test script
    Code:
    Filesystem           1K-blocks      Used Available Use% Mounted on
    tmpfs                    82624        12     82612   0% /dev
    tmpfs                     4096         0      4096   0% /sqlite_stmt_journals
    /dev/stl6               200996    133668     67328  67% /system
    /dev/stl5               150644    121384     29260  81% /data
    /dev/stl7                80576     42896     37680  53% /cache
    /dev/stl10                7729       776      6953  10% /efs
    /dev/bml8                 4096      4096         0 100% /xbin
    /dev/stl7                80576     42896     37680  53% /data/dalvik-cache
    after using test script
    Code:
    Filesystem                Size      Used Available Use% Mounted on
    tmpfs                    80.7M     12.0K     80.7M   0% /dev
    tmpfs                     4.0M         0      4.0M   0% /sqlite_stmt_journals
    /dev/stl6               196.3M    130.5M     65.8M  67% /system
    /dev/stl5               147.1M     52.8M     94.3M  36% /data
    /dev/stl7                78.7M     41.9M     36.8M  53% /cache
    /dev/stl10                7.5M    776.0K      6.8M  10% /efs
    /dev/bml8                 4.0M      4.0M         0 100% /xbin
    /dev/stl7                78.7M     41.9M     36.8M  53% /data/dalvik-cache
    suddenly I have near 100mb free space on /data

    ---------- Post added at 03:46 PM ---------- Previous post was at 03:27 PM ----------

    I have now uploaded the newer version of the script which now includes removal of the debugger dumps in /data/tombstones
    Phone: Samsung Galaxy i5700
    SOC: SGM Nextgen (Froyo)
    Me: github // relocate dalvik to /cache

  5. #5
    Moderator munchy_cool is on a distinguished road
    Join Date
    May 2010
    Location
    h3LL
    Posts
    3,486

    Default

    ok so am on samdroid and have already checked "move dalvik cache to sd" in samdroid tools, does that mean i cannot use the above method?

    also if i need to how do i go about it.

  6. #6
    Member equk is on a distinguished road
    Join Date
    May 2010
    Location
    UK
    Posts
    47

    Default

    Quote Originally Posted by munchy_cool View Post
    ok so am on samdroid and have already checked "move dalvik cache to sd" in samdroid tools, does that mean i cannot use the above method?

    also if i need to how do i go about it.
    not sure how the samdroid "move dalvik to sd" is coded so am unsure would guess there is a undo script to move the dalvik-cache back to the phone memory?

    then you can apply this one
    Phone: Samsung Galaxy i5700
    SOC: SGM Nextgen (Froyo)
    Me: github // relocate dalvik to /cache

  7. #7
    Moderator munchy_cool is on a distinguished road
    Join Date
    May 2010
    Location
    h3LL
    Posts
    3,486

    Default

    Quote Originally Posted by equk View Post
    not sure how the samdroid "move dalvik to sd" is coded so am unsure would guess there is a undo script to move the dalvik-cache back to the phone memory?

    then you can apply this one
    Thanks a lot man,
    let's ask the Boss how to do it,
    Leshak, any help?

  8. #8
    Senior Member kenshin is on a distinguished road
    Join Date
    Apr 2010
    Location
    Kaoru's dojo
    Posts
    812

    Default

    So this can't be used together with samdroid's app2sd implementation (not the move dalvik-cache feature)? The original cyanogenmod wiki referenced mentioned this.

    Well the first post already stated no to use with apps2sd, but it appears in previous implementations that the dalvik-cache moving is integrated with the app moving hence the warning.


    With the samdroid implementation this is seperate so there is potential here of even including it with the original samdroid tools. Just read thru the script and the potential is there.
    Last edited by kenshin; 06-06-2010 at 08:28 PM.

  9. #9
    Junior Member Skyfall is on a distinguished road
    Join Date
    May 2010
    Location
    UK
    Posts
    27

    Default

    Thanks, I put this update through earlier and no problems, one question though: if I wish to clear the dalvik cache from the recovery console will it still clear it in the new location? Don't want something going wrong in that respect.

  10. #10
    Junior Member vato is on a distinguished road
    Join Date
    May 2010
    Location
    Ekaterinburg
    Posts
    24

    Default

    This script only moves dalvik-cache to /cache, but i see the same folder on /data
    Can i manually delete dalvik-cache on /data?


 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts