[SCRIPT][1/22/2011] A Simple Cache2Cache for CM 6.x and 7.x ROMs

Search This thread

natemup

Senior Member
Jun 22, 2010
427
45
San Francisco
natemup.blogspot.com
do I need to reflash every time I upgrade a ROM?

I had been having success on GSB 1.6, but when I went to 1.7 without reflashing this script, half my apps were gone and I had 76KB availble for apps. :(((

Attempting now to wipe, reflash (the rom AND this script this time), and see if I can salvage anything...
 

doogald

Senior Member
May 27, 2010
1,387
337
do I need to reflash every time I upgrade a ROM?

I had been having success on GSB 1.6, but when I went to 1.7 without reflashing this script, half my apps were gone and I had 76KB availble for apps. :(((

Attempting now to wipe, reflash (the rom AND this script this time), and see if I can salvage anything...

Sure do. Flashing the ROM erases the script, so you need to reflash it when you reflash the ROM.

Assuming you are GSB, every time you upgrade, even for a no-wipe update, if you want cache2cache to still be there, you must:

- [optional, but strongly recommend] Nandroid backup
- Wipe Dalvik
- Flash GSB
- Flash gapps
- Flash xtrcache2cache
- Restart
 

natemup

Senior Member
Jun 22, 2010
427
45
San Francisco
natemup.blogspot.com
Sure do. Flashing the ROM erases the script, so you need to reflash it when you reflash the ROM.

Assuming you are GSB, every time you upgrade, even for a no-wipe update, if you want cache2cache to still be there, you must:

- [optional, but strongly recommend] Nandroid backup
- Wipe Dalvik
- Flash GSB
- Flash gapps
- Flash xtrcache2cache
- Restart
for app recovery purposes, I re-flashed the ROM, gapps, and then this script, and up until today, I assumed the script was working due all my apps being back and not getting "low memory" warnings right off the bat.

Today, though, after installing one extra app, I got the warning, so I used the Terminal Emulator to check, and apparently, my /data is using 88% (141M used) compared to /cache's 84% (109.3M used).

Is this normal, or is the script only partially working for me right now?
 

zach.xtr

Senior Member
Apr 9, 2010
943
82
Tallahassee, FL
for app recovery purposes, I re-flashed the ROM, gapps, and then this script, and up until today, I assumed the script was working due all my apps being back and not getting "low memory" warnings right off the bat.

Today, though, after installing one extra app, I got the warning, so I used the Terminal Emulator to check, and apparently, my /data is using 88% (141M used) compared to /cache's 84% (109.3M used).

Is this normal, or is the script only partially working for me right now?

This sounds normal. Even cache2cache has limits ;) and it sounds like you are just using a lot of space.

Sent from my Eris using XDA App
 
  • Like
Reactions: natemup

natemup

Senior Member
Jun 22, 2010
427
45
San Francisco
natemup.blogspot.com
This sounds normal. Even cache2cache has limits ;) and it sounds like you are just using a lot of space.

Sent from my Eris using XDA App
Fair enough.

In other news, a guy in the GSB ROM thread just told me my current problem of not receiving any of my SMS texts lately is likely due to c2c. Any fix or suggestions for that? I don't want to have to uninstall/reinstall/move to SD (obviously not in that order) all the extra apps I've gotten because of c2c just to start getting my texts again....
 

tazzpatriot

Senior Member
Mar 24, 2010
9,290
704
from the MassHole state
Fair enough.

In other news, a guy in the GSB ROM thread just told me my current problem of not receiving any of my SMS texts lately is likely due to c2c. Any fix or suggestions for that? I don't want to have to uninstall/reinstall/move to SD (obviously not in that order) all the extra apps I've gotten because of c2c just to start getting my texts again....

Hhhmm I've added c2c to my blackened rom and no one has said it messed up texts

sent from my invisable htc thunder bolt
 

doogald

Senior Member
May 27, 2010
1,387
337
Fair enough.

In other news, a guy in the GSB ROM thread just told me my current problem of not receiving any of my SMS texts lately is likely due to c2c. Any fix or suggestions for that? I don't want to have to uninstall/reinstall/move to SD (obviously not in that order) all the extra apps I've gotten because of c2c just to start getting my texts again....

The typical fix that I read for texts not arriving is to Nandroid backup what you have and install (or Nandroid restore, if you have one) a close-to-stock, HTC frameworks ROM like xtrSENSE, xtrROM, PlainJane, etc. Quite often texts will flood in, and then restoring your new ROM (like GSB) will find that they continue to work. If they do not start arriving when you install xtrSENSE et. al., that's the time to call Verizon and see if they can reset your account.

I have been using c2c on the xtr ROMs for quite a while, and on Froyo and GB ROMs since this was available, with absolutely no problems with SMS. Correlation does not mean causation.
 

tomlang

Senior Member
Jul 27, 2008
266
38
Zynga Poker and low memory warnings

Has anyone other than me had memory issues with Zynga Poker?

I've been running GSB with and without c2c and with various numbers of apps installed (either in internal or sd memory). The only case where I don't get repeated low-memory warnings from Zynga Poker (and never with any other app) is using the latest GSB (v2.0) without c2c. Simply adding c2c causes memory warnings to appear.
 

zach.xtr

Senior Member
Apr 9, 2010
943
82
Tallahassee, FL
Has anyone other than me had memory issues with Zynga Poker?

I've been running GSB with and without c2c and with various numbers of apps installed (either in internal or sd memory). The only case where I don't get repeated low-memory warnings from Zynga Poker (and never with any other app) is using the latest GSB (v2.0) without c2c. Simply adding c2c causes memory warnings to appear.

Can u run df -h and post the output? I am thinking the way apps are more stored in data than system with GB this mod may not have the same result... can anyone that can post their output of df -h?

Sent from my Eris using XDA App
 

zach.xtr

Senior Member
Apr 9, 2010
943
82
Tallahassee, FL
All,

Based on a few posts I would like to get some statistics on what internal storage values actually are with GB... So I would like to ask anyone who is willing and able to complete the following from their phone.

Run the following adb command

Code:
adb shell busybox df -h > c:\phonestorage.txt

go to the c:\ directory on your pc and open the newley generated phonestorage.txt file and post the content along with what ROM you are using. Below is the output example.

Code:
Filesystem                Size      Used Available Use% Mounted on

tmpfs                    95.5M         0     95.5M   0% /dev

tmpfs                     4.0M         0      4.0M   0% /sqlite_stmt_journals

/dev/block/mtdblock3    170.0M    143.9M     26.1M  85% /system

/dev/block/mtdblock5    159.5M     26.7M    132.8M  17% /data

/dev/block/mtdblock4    130.0M      1.1M    128.9M   1% /cache

/dev/block/mmcblk0p2    457.4M     70.7M    362.2M  16% /system/sd

/dev/block//vold/179:1

                          6.9G      2.5G      4.3G  37% /sdcard

Thats it! :)
 

tomlang

Senior Member
Jul 27, 2008
266
38
Can u run df -h and post the output? I am thinking the way apps are more stored in data than system with GB this mod may not have the same result... can anyone that can post their output of df -h?

Sent from my Eris using XDA App

I'll have to do that later. I want to modify my original statement, in that GSB has the low memory problem reported by Zynga Poker with or without c2c installed. It just takes longer to appear without c2c. Could it be some kind of memory leak? Zynga software is notoriously buggy.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    Due to a number of requests I have built a flashable .zip that will install a simple cache2cache script for CyanogenMod 6.x and 7.x ROMs.

    NAND backup BEFORE you try this!

    From user feedback it seems that if you are ALREADY running Apps2sd this causes issues with apps that where installed to the SD card and you will have to remove and re download them. There have been no reports of issues if you flash PRIOR to enabling Apps2sd ...


    Per dingermtb: check out post http://xdaforums.com/showpost.php?p=11487856&postcount=58 for an easy fix for Apps2sd.

    By using this script the dalvik-cache has been relocated from the internal /data/dalvik-cache/ directory to the internal /cache/dalvik-cache directory. The Eris comes with an internal /cache/ file block of 130mb that is not used much (CyanogenMod does store the cache of system apps in the /cache file block but NOT any apps that are downloaded from the market)! So by moving the dalvik-cache to this free area you now have more space on internal /data/ for apps and over 75mb in internal /cache/ for dalvik-cache. This means that you can probably install close to 75-100 apps WITHOUT having to worry about apps2sd!

    This IS NOT a Custom MTD script as I wanted to keep it simple. This solution is not as "ideal" as a Custom MTD scripts work but it is a bit easier, safer, and simpler... Plus it works ;)

    How do I know it worked?
    So why does my Settings>SD card & phone storage>Internal phone storage only show 150mb or less? This is because this number ONLY reflects the /data/ file block on your phone and does not "see" the /cache/ block that is now being used for dalvik-cache storage.

    From adb or Terminal Emulator (you can get it free from the market if your ROM does not already have it) run the follow command:

    Code:
    df -h

    You will see that your /cache partition now is more used and that your /data partition is less used.

    Also you can browse to the /cache/dalvik-cache/ folder using your favorite file explorer and see that you now have files starting with "data@..." and not just "system@..."

    What does it do?
    Since CyanogenMod already uses an init.d framework that runs during boot on his ROMs it was easy to add a new shell script that would automatically run with the other boot scripts in the /system/etc/init.d/ folder.

    This simply adds the following 07cache2cache file to /system/etc/init.d/

    Code:
    # !/system/bin/sh
    #
    # Author: zach.xtr Jan 2011
    # Moves the /data/dalvik-cache files to largely unused /cache/dalvik-cache location and symlinks
    # This code is intended for the ERIS, use on other phones may not work due to predefined file block sizes...
    
    log -p i -t cache2cache "Running cache2cache to move data/dalvik-cache to cache/dalvik-cache..."; 
    
    # Mount filesystem
    /system/xbin/busybox mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
    
    # Make sure final /cache/ location is setup correctly
    if [ ! -d /cache/dalvik-cache ];
    then
    	log -p i -t cache2cache "/cache/dalvik-cache directory not found, creating and adding permissions..."; 
    	/system/xbin/busybox mkdir /cache/dalvik-cache;
    	/system/xbin/busybox chown 1000:1000 /cache/dalvik-cache;
    	/system/xbin/busybox chmod 777 /cache/dalvik-cache
    fi;
    
    if [ -d /data/dalvik-cache ] && [ ! -h /data/dalvik-cache ];
    then
    	log -p i -t cache2cache "Moving files from /data/dalvik-cache to /cache/dalvik-cache"; 
    	/system/xbin/busybox cp -fp /data/dalvik-cache/* /cache/dalvik-cache;
    	/system/xbin/busybox rm -r /data/dalvik-cache;
    	log -p i -t cache2cache "Creating Symbolic Link of /cache/dalvik-cache as /data/dalvik-cache";
    	/system/xbin/busybox ln -s /cache/dalvik-cache /data/dalvik-cache;
    	/system/xbin/busybox chown 1000:1000 /data/dalvik-cache
    	/system/xbin/busybox chmod 0771 /data/dalvik-cache
    fi;
    
    # Clean up 
    /system/xbin/busybox mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system

    How do I remove it?
    Since it only adds 1 file all you need to do is delete the /system/etc/init.d/07cache2cache file and reboot your phone. One could use adb or RootExplorer (or similar) file manager.

    NOTE: if you have been using this for a while and have installed enough apps and THEN remove it I am not sure what will happen when you reboot... Basically you may not have enough space in the /data file block alone.
    2
    do I need to reflash every time I upgrade a ROM?

    I had been having success on GSB 1.6, but when I went to 1.7 without reflashing this script, half my apps were gone and I had 76KB availble for apps. :(((

    Attempting now to wipe, reflash (the rom AND this script this time), and see if I can salvage anything...

    Sure do. Flashing the ROM erases the script, so you need to reflash it when you reflash the ROM.

    Assuming you are GSB, every time you upgrade, even for a no-wipe update, if you want cache2cache to still be there, you must:

    - [optional, but strongly recommend] Nandroid backup
    - Wipe Dalvik
    - Flash GSB
    - Flash gapps
    - Flash xtrcache2cache
    - Restart
    1
    Pretty cool. I'm never low on space so I won't need this, but thanks for creating it.

    Is it possible for this to cause apps to slow down, since when they try to access the cache it'll be on the (slower) SD card?

    No :)

    This does not use the SD card in any way; it only redistributes from the INTERNAL /data file block to the INTERNAL /cache file block...

    If anything you may gaine a minor permormance improvement as you will have more "working" space...
    1
    This, along with CELEB 4.3, is the fastest and best my Eris has ever run. I'm blown away! Those extra megs of memory were what my phone needed to pick up the pace.
    1
    for app recovery purposes, I re-flashed the ROM, gapps, and then this script, and up until today, I assumed the script was working due all my apps being back and not getting "low memory" warnings right off the bat.

    Today, though, after installing one extra app, I got the warning, so I used the Terminal Emulator to check, and apparently, my /data is using 88% (141M used) compared to /cache's 84% (109.3M used).

    Is this normal, or is the script only partially working for me right now?

    This sounds normal. Even cache2cache has limits ;) and it sounds like you are just using a lot of space.

    Sent from my Eris using XDA App