Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,736,733 Members 54,069 Now Online
XDA Developers Android and Mobile Development Forum

[SCRIPT] No-lag solution to CM7/9 "low memory" notifications (STEP BY STEP,FIXED TB)

Tip us?
 
revthanki
Old
(Last edited by revthanki; 10th March 2012 at 12:58 PM.) Reason: Working Titanium Backup!
#1  
revthanki's Avatar
Senior Member - OP
Thanks Meter 145
Posts: 245
Join Date: Apr 2010
Lightbulb [SCRIPT] No-lag solution to CM7/9 "low memory" notifications (STEP BY STEP,FIXED TB)

Quote:
23/01/12 - Now with Titanium Backup support!
The Titanium Backup team is awesome. I contacted them and within 3 days they had a working fix. To make sure that titanium backup works properly all you need to do is download the latest version from the market, go into 'preferences' and select 'follow all symbolic links' in the 'Troubleshooting' section at the bottom. That's it. Now you'll be able to backup normally and then restore your apps in any other rom. Neat!

Okay, I've found a rather excellent solution to the low storage problem that plagues the CM7 and CM9 roms - without causing the lagginess of the ".nodatadata" approach. It's not my work but was posted by drefnel on the Cyanogenmod forum. It's very smart: instead of moving the whole of /datadata (fast yaffs2) to /data (slower ext4) and so introducing lag it keeps most apps' non-performance critical data on /data and moves performance critical sqlite databases and xml preference files to the fast /datadata.

Installing this fix is a two step process:
  • Phase 1 - some prep, takes around 10 minutes to complete. Only has to be done once.
  • Phase 2 - running the script whenever you've installed new apps and used them once or twice. this just involves hitting a shortcut on your home screen. boom!

The original guide can be found here we need to make a few alterations and I've done a step-by-step below:



Step by step guide
  • I take no responsibility if using these instructions messes up your phone. They worked for me and you should always be able to restore using the clockworkmod backup. But you can't say you haven't been warned.
  • Make sure you're running CM7 or TeamHacksung's CM9 or Onecosmic ICS.
  • This will NOT work on encrypted phones.
  • DO A NANDROID BACKUP BEFORE YOU BEGIN.

Phase 1 - (if you've already used the ".nodatadata" method then start at step 4)

1. Download Terminal Emulator

2. Open terminal emulator and then enter each of the following followed by return:
  • su
  • touch /datadata/.nodatadata

3. Reboot (this might take a while as the OS will be making changes to your filesystem).

4. Open terminal emulator and then enter each of the following followed by return:
  • su
  • rm /data/data/.nodatadata

5. Reboot into recovery, go to "mounts & storage" and then select "format datadata". Reboot normally.

6. Go to the market and download GScript Lite. Open it and close it again - this should create a folder called "gscript" in your sdcard. Unzip the file attached in this post and place the script in it in that folder.

7. Open up GScript Lite, press menu and add script. Click load file, select the script file, make sure that "needs SU" is selected and click save.

8. Run the script by tapping it. You should see GScript report its progress and finally the script should finish. Press close and gscript will crash out (can't have it all ).

Phase 2

Add a shortcut to this script on your desktop.
  • CM7 - long-press and hold a blank area of your home screen, select 'add shortcut', and then select 'gscript lite'. select the script you've just added.
  • CM9 - go into your app drawer, select the 'widgets' tab, find 'gscript lite', press and hold it and move it onto your home screen. select the script you've just added.

You should use the shortcut after you've installed new apps and used them a few times. There's no harm in not using the script for a while, all that will happen is that app may become a bit laggy until you use the script to move its data to /datadata.


That's it. Congratualtions!


You can flash new CM roms and the script will carry on working fine, but if you wipe data in recovery then you'll have to start from the beginning

You won't be able to easily go back to the original configuration or use the ".nodatadata" method (you'll need to Titanium Backup, wipe everything and then restore), but you'll never miss them.

Good luck

I hope this helps people out. We should find a way of better automating the steps to make it more noob friendly and maybe Team Hacksung and One Cosmic could incorporate it into their ROMs. (Essentially the script needs to be run periodically to make sure that the performance critical /data/data elements of new apps are copied across to /datadata - apart from that it's not too different from the ".nodatadata" approach).
Attached Files
File Type: zip move_data_to_yaffs_NOT_FLASHABLE.zip - [Click for QR Code] (1.7 KB, 1406 views)
The Following 41 Users Say Thank You to revthanki For This Useful Post: [ Click to Expand ]
 
diablosv36
Old
#2  
Senior Member
Thanks Meter 23
Posts: 125
Join Date: Nov 2010
Personally using the much simpler .nodatadata approach, i found that after a rom (cm9) install, most lag goes away after using it for a few hours, although I have heard the speed of the flash memory is not equal on all devices... so could be laggy for some regardles of usage.
 
revthanki
Old
#3  
revthanki's Avatar
Senior Member - OP
Thanks Meter 145
Posts: 245
Join Date: Apr 2010
Yup I've tried both and the script approach is definitely much quicker in my case. I'm going to see if I can simplify this procedure somewhat.
The Following 2 Users Say Thank You to revthanki For This Useful Post: [ Click to Expand ]
 
1eoltl
Old
#4  
Junior Member
Thanks Meter 0
Posts: 8
Join Date: Feb 2011
Location: Kelowna
Sorry for being a noob.. I am not sure how to apply the script to my Android device... Should I use Terminal Emulator on my Galaxy S and type the script in there? Would you mind to guide me through the process? Thanks a lot
 
revthanki
Old
#5  
revthanki's Avatar
Senior Member - OP
Thanks Meter 145
Posts: 245
Join Date: Apr 2010
Now with a step-by-step guide.
 
1eoltl
Old
#6  
Junior Member
Thanks Meter 0
Posts: 8
Join Date: Feb 2011
Location: Kelowna
Man you are awesome! Thanks for your guide!
 
Zatta
Old
(Last edited by Zatta; 16th January 2012 at 08:36 AM.)
#7  
Zatta's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 1393
Posts: 2,089
Join Date: Dec 2010
Location: Sneek
Wouldn't it be an idea tu use scriptmanager (free or pro) instead of gscript? it can run scripts on boot.
Maybe later, when the standard kernel for cm9 will support init.d, it can be an init.d script?

And oh, I will put a link to this thread in the wiki, you can edit the wiki yourself also if you ask for acces.
 
Code124Y
Old
#8  
Code124Y's Avatar
Senior Member
Thanks Meter 194
Posts: 875
Join Date: Oct 2010
Location: georgetown

 
DONATE TO ME
seem like there is no one try on OneCosmic, and im going it a shot!
will report later~
 
revthanki
Old
(Last edited by revthanki; 16th January 2012 at 09:45 AM.)
#9  
revthanki's Avatar
Senior Member - OP
Thanks Meter 145
Posts: 245
Join Date: Apr 2010
Quote:
Originally Posted by Zatta View Post
Wouldn't it be an idea tu use scriptmanager (free or pro) instead of gscript? it can run scripts on boot.
Maybe later, when the standard kernel for cm9 will support init.d, it can be an init.d script?

And oh, I will put a link to this thread in the wiki, you can edit the wiki yourself also if you ask for acces.

Good points. The reason I chose GScript was its user friendliness and simplicity. There are define advantages in running this script at boot. (I'd much prefer to have things run automatically before the GUI appears (as in init.d) rather than clog up GUI boottime as Script Manager would require.)

The phenomenal uptime I get with Android means that I don't reboot very often. Ideally we'd want something that monitored the data/data folder and ran the script on the appearance of new folders. I'm not sure how you'd automate that without resorting to Tasker. Maybe init.d is the best we can do when it's supported. In the meantime a GScript shortcut on the desktop that I hit once every couple of days feels like the best option so far!

Sent from my GT-I9000 using XDA App
 
Code124Y
Old
#10  
Code124Y's Avatar
Senior Member
Thanks Meter 194
Posts: 875
Join Date: Oct 2010
Location: georgetown

 
DONATE TO ME
Quote:
Originally Posted by Code124Y View Post
seem like there is no one try on OneCosmic, and im going it a shot!
will report later~
Tested on OneCosmic and it working good for all but picture/gallery gone...
what i mean is it scan no photo nor any image on my phone~
using gallery+ giving me the same view(nothing in gallery)
but other then this 2 gallery, im try with quickpic also and yup it show pic~

but i want the original picture gallery from the 4.0.3... any help?

Tags
cm7, cm9, low space, script
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes