New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
Quinny899
Old
(Last edited by Quinny899; 31st January 2012 at 10:31 PM.)
#1  
Quinny899's Avatar
Recognized Contributor - OP
Thanks Meter 2872
Posts: 5,430
Join Date: Jan 2011
Location: Bolton le Sands, Near Lancaster, UK Likes: Android, Linux Hates: Windoze, Apple

 
DONATE TO ME
Default [HOW TO][SCRIPT] Swap

I've made a simple script that activates swap on boot

What is swap?
Swap puts the 'less important RAM' on the sdcard, making the device faster. It is best when used with v6 Supercharger. (See my other thread)

Requirements:
An SD card to BE IN THE DEVICE AT BOOT, POSSIBLY EVERY BOOT, with at least 150mb of space free on it
A 8/16gb Archos G9 (NOT THE 250GB MODEL)
Root
Script Manager from the market
Busybox (See my other thread)

What to do:
1. Download this: (long press > save link)
http://db.tt/LP7tliLZ
2. Using Script Manager, locate the downloaded file and rename (long press > rename) to 90swapon.sh
3. Copy (long press > copy) it to /data and then tap it to bring up a pop up window
4. Tap the little "pirate flag" (superuser logo) and the "gear" (run on boot)
5. Tap run and wait for it to say swap is on
6. Reboot
7. Hit thanks, you are done

Note: to check if it works, type "free" into a terminal, and it will give you values for swap. It takes a bit to kick in, so it won't be on straight away on boot

Sent from my ARCHOS 80G9 using xda premium
 
Devices:
Galaxy Nexus
Archos 80 G9
LG GT540
Acer D255
The Following 12 Users Say Thank You to Quinny899 For This Useful Post: [ Click to Expand ]
 
jipee296
Old
#2  
Member
Thanks Meter 5
Posts: 69
Join Date: Oct 2010
thank you for this and all the stuff you did/contribute for our G9
 
Quinny899
Old
#3  
Quinny899's Avatar
Recognized Contributor - OP
Thanks Meter 2872
Posts: 5,430
Join Date: Jan 2011
Location: Bolton le Sands, Near Lancaster, UK Likes: Android, Linux Hates: Windoze, Apple

 
DONATE TO ME
Quote:
Originally Posted by jipee296 View Post
thank you for this and all the stuff you did/contribute for our G9
I actually do most of this stuff for myself and then upload it for the community, but thanks

Sent from my ARCHOS 80G9 using xda premium
 
Devices:
Galaxy Nexus
Archos 80 G9
LG GT540
Acer D255
 
jipee296
Old
#4  
Member
Thanks Meter 5
Posts: 69
Join Date: Oct 2010
Quinny,after using this script for two days, i always get a random reboot or the devices freezes... any help?
 
Quinny899
Old
#5  
Quinny899's Avatar
Recognized Contributor - OP
Thanks Meter 2872
Posts: 5,430
Join Date: Jan 2011
Location: Bolton le Sands, Near Lancaster, UK Likes: Android, Linux Hates: Windoze, Apple

 
DONATE TO ME
Quote:
Originally Posted by jipee296 View Post
Quinny,after using this script for two days, i always get a random reboot or the devices freezes... any help?
Don't have that issue. It's not to do with swap

Sent from my ARCHOS 80G9 using Tapatalk HD
 
Devices:
Galaxy Nexus
Archos 80 G9
LG GT540
Acer D255
 
Denkel
Old
#6  
Junior Member
Thanks Meter 1
Posts: 8
Join Date: Feb 2012
Default gorymp mine

Hi, thanks for that job, I'm going to try it!
But I have one question:
Why, if the G9 recongnizes de main memory as SD, is not posible to do that with the main memory instead of an external card??
I prefer to lose even 1Gb on my memory for increasing my perfomance...
 
iourine
Old
#7  
Member
Thanks Meter 6
Posts: 40
Join Date: Feb 2012
Location: Moscow
Quote:
Originally Posted by Denkel View Post
Why, if the G9 recongnizes de main memory as SD, is not posible to do that with the main memory instead of an external card??
First of all, because the swap is continuously rewritten as the system tries to distribute itself between physical RAM and swap in the optimal way. Any type of flash memory allows only a limited number of read-write cycles - and not really big. So, if you put swap onto it, you will kill it in a relatively short time . If it is a card, you just replace it; if it is the main ROM, you ruin the entire device.

Аnd once the swap volume is corrupt, results are unpredictable - that is what might happen to jipee296. jipee296, did you use an old card that had been rewritten many times before? Try a brand new one just to see if the problem goes away.

HDDs do not have this limitation, so if it were the HDD model, there would be the perfect place for swap. But this is not the case.

Quinny899, will the system start at all if swap is activated but the card is missing or corrupt? Actually there are two more inctructions missing for a complete solution: how to replace the SD card (will the swap be re-built automatically on a new card?) and how to remove swap completely. Any new step should be repeatable and reversible.

BTW, does someone know the exact brand of SD card reader used in G9 (hopefully it is the same in all models), or at least its performance characteristics (class, read spped, write speed)? This would be helpful to choose the optimal SD - as fast as the controller can support, but not an even more fast and more expensive one.
The Following User Says Thank You to iourine For This Useful Post: [ Click to Expand ]
 
Quinny899
Old
#8  
Quinny899's Avatar
Recognized Contributor - OP
Thanks Meter 2872
Posts: 5,430
Join Date: Jan 2011
Location: Bolton le Sands, Near Lancaster, UK Likes: Android, Linux Hates: Windoze, Apple

 
DONATE TO ME
Quote:
Originally Posted by iourine View Post
First of all, because the swap is continuously rewritten as the system tries to distribute itself between physical RAM and swap in the optimal way. Any type of flash memory allows only a limited number of read-write cycles - and not really big. So, if you put swap onto it, you will kill it in a relatively short time . If it is a card, you just replace it; if it is the main ROM, you ruin the entire device.

Аnd once the swap volume is corrupt, results are unpredictable - that is what might happen to jipee296. jipee296, did you use an old card that had been rewritten many times before? Try a brand new one just to see if the problem goes away.

HDDs do not have this limitation, so if it were the HDD model, there would be the perfect place for swap. But this is not the case.

Quinny899, will the system start at all if swap is activated but the card is missing or corrupt? Actually there are two more inctructions missing for a complete solution: how to replace the SD card (will the swap be re-built automatically on a new card?) and how to remove swap completely. Any new step should be repeatable and reversible.

BTW, does someone know the exact brand of SD card reader used in G9 (hopefully it is the same in all models), or at least its performance characteristics (class, read spped, write speed)? This would be helpful to choose the optimal SD - as fast as the controller can support, but not an even more fast and more expensive one.
To remove just delete the file you pushed. And I ran swap on my old phone for 2 years and nothing happened to the sd

Sent from my HTC Desire HD using XDA Premium HD app
 
Devices:
Galaxy Nexus
Archos 80 G9
LG GT540
Acer D255
 
DeeDroid
Old
#9  
Member
Thanks Meter 6
Posts: 58
Join Date: Jan 2009
Location: Koblenz
Quote:
Originally Posted by jipee296 View Post
Quinny,after using this script for two days, i always get a random reboot or the devices freezes... any help?
I didn't try the script yet but used "swapper 2". I assume this does the same thing and I get random reboots and freezes too. I tried different values for swappiness, internal memory or sdcard, swap file and swap partition, the problem remains
 
Quinny899
Old
#10  
Quinny899's Avatar
Recognized Contributor - OP
Thanks Meter 2872
Posts: 5,430
Join Date: Jan 2011
Location: Bolton le Sands, Near Lancaster, UK Likes: Android, Linux Hates: Windoze, Apple

 
DONATE TO ME
Quote:
Originally Posted by SE-X1 View Post
I didn't try the script yet but used "swapper 2". I assume this does the same thing and I get random reboots and freezes too. I tried different values for swappiness, internal memory or sdcard, swap file and swap partition, the problem remains
Swapper 2 has freezing issues, the script doesn't

Sent from my Desire HD using XDA Premium HD app
 
Devices:
Galaxy Nexus
Archos 80 G9
LG GT540
Acer D255


XDA PORTAL POSTS

What’s Possible with CASUAL & How to Make Your Own CASUAL – XDA Developer TV

XDA Elite Recognized Developer AdamOutler is known … more

Pearl Chen to Talk NFC Development at XDA:DevCon 2013

From HTML to LEDs or Android to Arduino, Hardware Hacking is a pastime of many people … more

Avoid Framework Bootloops on Xperias Running Jelly Bean

If you’re a Sony device owner running a stock Android Jelly Bean firmware and … more

Forum Added for the Samsung Galaxy Mega

What do you do when the Galaxy Note line is simply not big enough? You get theSamsung Galaxy Mega. … more