+ Reply to Thread
Results 1 to 10 of 113
- 06-05-2010 11:31 PM #1Member
- Join Date
- May 2010
- Location
- UK
- Posts
- 47
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.
I thought why can't we move/repoint dalvik-cache to this nearly empty partition?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 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:
Note: as with other thread - Dalvik doesn't touch the SDCard with this methodCode: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
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
also as with most stuff, small disclaimerCode: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

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
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 spaceLast edited by H3LLBOY911; 10-04-2010 at 10:31 PM. Reason: added notes relating to low free space and slowdowns, possible cause is JIT
-
- 06-06-2010 01:41 PM #2Administrator
- Join Date
- Dec 2009
- Location
- Moscow, Russia
- Posts
- 3,712
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!
- 06-06-2010 02:22 PM #3Moderator
- Join Date
- May 2010
- Location
- h3LL
- Posts
- 3,486
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.
-
- 06-06-2010 06:46 PM #4Member
- Join Date
- May 2010
- Location
- UK
- Posts
- 47
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.
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.Code:65.7M /data/tombstones
before using test script
after using test scriptCode: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
suddenly I have near 100mb free space on /dataCode: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

---------- 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
- 06-06-2010 06:52 PM #5Moderator
- Join Date
- May 2010
- Location
- h3LL
- Posts
- 3,486
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.
- 06-06-2010 07:03 PM #6Member
- Join Date
- May 2010
- Location
- UK
- Posts
- 47
- 06-06-2010 07:04 PM #7Moderator
- Join Date
- May 2010
- Location
- h3LL
- Posts
- 3,486
- 06-06-2010 07:22 PM #8Senior Member
- Join Date
- Apr 2010
- Location
- Kaoru's dojo
- Posts
- 812
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.
- 06-06-2010 08:14 PM #9Junior Member
- Join Date
- May 2010
- Location
- UK
- Posts
- 27
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.
- 06-07-2010 01:03 PM #10Junior Member
- Join Date
- May 2010
- Location
- Ekaterinburg
- Posts
- 24
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)


2Likes
LinkBack URL
About LinkBacks
Reply With Quote
would guess there is a undo script to move the dalvik-cache back to the phone memory?

Bookmarks