Go Back   xda-developers > HTC Dream: G1 > G1 Apps and Games


View Poll Results: Does swap increase usability of Android OS?
Yes 179 79.20%
No 47 20.80%
Voters: 226. You may not vote on this poll

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 15th February 2009, 10:57 PM
ex87 ex87 is offline
Member
 
Join Date: Sep 2008
Location: Ventspils
Posts: 42
Default Swapper [0.1.3] - tool for creating and using swap

Simple application for "extending memory". Helps when you need some memory for non active applications (like music player + browser + maps + etc...).
Idea taken from http://forum.xda-developers.com/showthread.php?t=482228

Requires root and SD/SDHC card.

Warning: SD card will be used as swap space. It can (and will) shorten SD card lifespan.

Application creates/rewrites swapfile.swp file on sdcard and mounts it as swap. It can use swap partition too. It can change swappiness behaviour ( http://forum.xda-developers.com/show...0&postcount=33 )
Phone switches between tasks slower, but can run more programs in parallel.
Changes remains until reboot. Disable swap to eject/mount card.

It's my first application for Android. It goes as is, without any warranty. Use at your own risk.

Sorry for my English.

If You have any problems, please check http://code.google.com/p/a-swapper/wiki/Settings , it could contain some answers. If not, please feel free to fill bug.

Requested features
  • Configurable swap size
  • Configurable location of swap file (fixed location reset bug)
  • Autostart (some reports says it doesn't work)
  • Threaded swap creation
  • Widget
  • Memory buffer flusher (from pagubg)
  • Swap partition support
  • Permission fix
= finished = finished, needs testing = not finished

History
0.1.3: Swap partition support. Debug logging on problems.
0.1.2: a-c Test builds
0.1.1: 1.5 build. Autostart, interface changed.
0.0.6: Stable build. Works with version 1.5
0.0.5: Added some features (path to swap file, progress indicator). Tweaked visual apperance.
0.0.3: Added swappiness settings (Thank you for pointing it out, MoridinBG), some information output.
0.0.2: First release

Moved to code.google.com.

http://code.google.com/p/a-swapper/

Last edited by ex87; 16th July 2009 at 11:34 AM.. Reason: Info update
Reply With Quote
Sponsored Links

  #2  
Old 16th February 2009, 06:38 PM
MoridinBG MoridinBG is offline
Member
 
Join Date: Jan 2007
Posts: 83
Default

Consider changing the default swappiness behaviour, as described in my post at page 3 of the thread. With the default value, 60, the phone uses the impossibly slow swap too much and after some use the entire system becames unusable.
Lowering it to a lower value, like 20 or 10 makes it swap rarely, while still using the swap to not force applications to unload and the system is usable, even after long time use.
Reply With Quote

  #3  
Old 17th February 2009, 10:48 PM
dwang dwang is offline
Senior Member
 
Join Date: Nov 2008
Posts: 1,316
Default

Does this really work? I tried it and set the swappiness to 10 and 20 and then went to the browser and loaded a bunch of "heavy" websites. After that I switched to the home screen and there was still a significant lag.
Reply With Quote

  #4  
Old 17th February 2009, 11:09 PM
unrafa unrafa is offline
Member
 
Join Date: Dec 2008
Posts: 67
Default

its working yes, program is probably good but swaping in embedded devices with so few memory like this is a terrible idea, keep testing anyway.

what maybe is worth the effort is looking at the kernel code and and recompile it removing first netfilter and some other unused things (or compile it as modules) to gain 1Mb or two, and gain significant speed removing the debug features that normal users doesnt want/need. there isnt much which can be done until someone figure out how to recover the other missing 128 mb who is said are eaten by graphic framebuffers.. i dont believe that.

Last edited by unrafa; 17th February 2009 at 11:23 PM..
Reply With Quote

  #5  
Old 18th February 2009, 09:56 AM
ex87 ex87 is offline
Member
 
Join Date: Sep 2008
Location: Ventspils
Posts: 42
Default

Yes, there are some lags, but it's the best "user friendly" way now available not to close nessesary background applications as far as I know (correct me, if I'm wrong).
Working for me (I wrote application for easy turning it on and off - using swap only when nessesary, not all the time).
Reply With Quote

  #6  
Old 27th February 2009, 10:15 AM
mystica555 mystica555 is offline
Junior Member
 
Join Date: Feb 2009
Posts: 26
Thumbs up

Quote:
Originally Posted by ex87 View Post
Simple application for "extending memory". Helps when you need some memory for non active applications (like music player + browser + maps + etc...).
Idea taken from http://forum.xda-developers.com/showthread.php?t=482228

Requires root and SD/SDHC card.
First off, nice work with my initial idea

Questions however: Can you make the swap space size configurable? Also, I see that you went with my original hunch of /sdcard/ . This poses some challanges: it is required that swap is turned off before you can mount the card as a flash drive in your PC. There are also other issues I will probably be able to think of when I'm not so tired.

A configurable option of either /system/sd/ (for LucidREM's JFvMod build) or /sdcard (for those who havent moved the Apps/Data/Caches to SD) would be ideal!

Thanks for making a great quick gui! I have no idea where to start with java.

Last edited by mystica555; 27th February 2009 at 10:19 AM.. Reason: tried it, found it does create on /sdcard
Reply With Quote

  #7  
Old 10th March 2009, 02:25 AM
ex87 ex87 is offline
Member
 
Join Date: Sep 2008
Location: Ventspils
Posts: 42
Default

If any of Swapper users use LucidREM's JFvMod build - please test swapspace placing to /system/sd/ . Thank you!
Reply With Quote

  #8  
Old 10th March 2009, 03:36 AM
a1t a1t is offline
Senior Member
 
Join Date: Nov 2008
Location: Denver
Posts: 109
Default Question

Yep, I'll be that first guy to ask the question. I will accept the consequences. Where can yo direct me to better understand the settings/configuration options available? I would like to understand this before I make changes. Also as a starter if you could recommend an appropriate config for an 8gb class 6 sd card, I would appreciate it.

Thanks to all!
Reply With Quote

  #9  
Old 10th March 2009, 11:06 AM
MoridinBG MoridinBG is offline
Member
 
Join Date: Jan 2007
Posts: 83
Default

Just to remind you. Set the Swappiness to 10 before or immediately after creating swap or you would experience incredible slowness in a couple of minutes.
__________________
Devices History: 4xTabletPC, 1xUMPC, 6xPocketPC, 2xInternetTablet, 2xSmartphone, 1xiPod Touch, 1xSony PSP, 1xAndroid
Current: HP tc4400 TabletPC HTC G1
Reply With Quote

  #10  
Old 10th March 2009, 11:24 AM
ex87 ex87 is offline
Member
 
Join Date: Sep 2008
Location: Ventspils
Posts: 42
Default

Settings:
Swap size = size of file for swapping.Here info for reading http://en.wikipedia.org/wiki/Swap_space
Location = path where to place swap file (Locations button contains predefined paths, one is /sdcard/swapfile.swp, other is /system/sd/swapfile.swp - for those, who divided their sd cards for application sorage).

In program you have swappiness option - range 0-100 - how much you would like to swap. My tests showed that best performance/usability (for my sd+phone) is 32 MB swap and swappiness = 10. Your preferences can differ.

Changes are saved till system restart. After restart you should reenable swap and reset swappiness. Configuration about swap size and location is saved in program. Before configuring swap path please disable swap.

In default place swap is blocking mounting procedure of phone to pc. If you want to mount it, you should disable swap.
About sd configuration - here is one link with instructions. I haven't done it myself yet because of slow sdhc ("quick" sd card is only 1 GB) http://forum.xda-developers.com/showthread.php?t=480582

Last edited by ex87; 10th March 2009 at 11:39 AM.. Reason: Some grammar corrections
Reply With Quote

Reply

Tags
android, memory, swap, swapper

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:59 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.