View Single Post
  #1 (permalink)  
Old 12-12-2010, 12:57 PM
mavblues's Avatar
PPCGeeks Regular
Join Date: Nov 2008
Posts: 105
Reputation: 265
mavblues is becoming a PPCGeeks regularmavblues is becoming a PPCGeeks regularmavblues is becoming a PPCGeeks regular
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Move Dalvik Cache

I take no credit for this. Found this on SDX (posted by Chibucks). Originally done for the Moment - works great on the Intercept.

When you do this, you'll have no need for Apps2SD. Frees up a bunch of memory on the phone! Put this on both of my kids' phones - one has 83MB free and the other has 94MB free. That's an increase of roughly 50MB from what the figures were pre-install!

Zip file attached so you don't have to adb (apply it through recovery). However, adb instructions are below for those that prefer doing it that way.

are you running out of room on /data? want more room?

one solution is to move your dalvik-cache from /data/dalvik-cache to the /cache folder...

what is the /cache folder?
the /cache folder from what i've read, is used for OTA updates from your provider... they vary in size. the moment's /cache folder is a whopping 116MB - mostly unused... take a look yourself, open up connectbot and type in 'df' and you can see the size of your partitions and what's used. other phones have much smaller /cache (i think the spica has 76MB, dream has like 20MB), while others have larger (epic and evo both have larger).

how do you do this?
boot your phone up in recovery and connect to your computer and "adb shell"... if your phone isn't recognized or what not, read the super-guide.

now in shell, type:
Code: [Select]
mv /data/dalvik-cache /cache/dc
this moves your current /data/dalvik-cache to the /cache partition under the 'dc' directory (you can rename it whatever you want)

then type in:
Code: [Select]
ln -s /cache/dc /data/dalvik-cache
this creates a symlink (path link) from /data/dalvik-cache to /cache (sort of like a forwarding address)

reboot, and voila, you'll save yourself around 60MB of space in /data (results may vary), which means more apps like ninja fruit or tom the cat. i went from 60MB free to 120MB.

it should hold on reboot... lemme know if it doesn't, there are other methods.

how do you go back? (in case sprint fixes our data lockup and has a big update)

remove the symlink -
Code: [Select]
rm /data/dalvik-cache
move davlik-cache back -
Code: [Select]
mv /cache/dc /data/dalvik-cache
and then remove the /cache file
Code: [Select]
rm -R /cache/dc
you can skip the second step if you want your phone to rebuild it's on davlik-cache... since the phone can rebuild davlik-cache, the risk isn't that large.

how does this affect performance?
so far, nothing noticeable on my part - my linpacks were similar before and after...

can you do this on ext2 / ext3 systems?
i wouldn't see why not, but you'll probably have to ask someone more in the know... i believe both the /data and /cache folders are mounted ext2 / ext3 in the init.rc, but don't quote me on that...

i take no credit for this - xda / samdroid / cyanogen all have done this previously... and once again, use at your own risk.
link references:

also note: it seems if you run out of room in /cache, the phone supposedly acts a little flaky, but as long as you have over 15MB, you should fine... but that's based on the samdroid comments.

edit to add: for those who prefer applying an through recovery... attached. i tested it out, and it worked for me. hopefully it'll work for whoever else is interested.
Attached Files
File Type: zip (826 Bytes, 50 views) Click for barcode!

Last edited by mavblues; 12-12-2010 at 01:06 PM.
Reply With Quote