yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] farmatito:
If I recall correctly swapper creates a swap file on the sdcard, in this case

it will not work with compcache due to a problem in the swap notify

function see http://article.gmane.org/gmane.linux.drivers.driver-project.devel/102.

It will work better if you use a swap partition togheter with compcache's ramzswap as i suggested.

rzstats is just a script that i created to check compcache and swap:

#!/system/bin/sh
#cat /proc/ramzswap
rzscontrol /dev/block/ramzswap0 -s
free
sysctl vm.swappiness
cat /proc/swaps

To start compcache and swap with different priorities add this code

to your userinit.sh file:

# Default swappiness
SWAP=40
PRIO=""
# Compcache setup
uname_r=`uname -r`
moddir=`find /system/modules -type d -name $uname_r`
insmod=/system/bin/insmod
$insmod $moddir/compcache/ramzswap.ko
rzscontrol /dev/block/ramzswap0 --disksize_kb=32120 --init
/usr/bin/swapon /dev/block/ramzswap0 -p 2
if test $? -eq 0 ; then
PRIO="-p 1"
fi
# Swap partition setup
if [ -e /dev/block/mmcblk0p3 ] ; then
/usr/bin/swapon /dev/block/mmcblk0p3 $PRIO
fi
echo $SWAP > /proc/sys/vm/swappiness

I would disable swapper of using it. You could also drop this

code to a file in /system/etc/init.d/98-swap.

For it to work you need the previously posted busybox binary with

support for swapon's -p switch.

Enjoy.
[G1 Android Development] n171n:
Thanks, I'll give this a try and report back. I may be wrong, but swapper has, in the advanced options, the ability to set it to use a swap partition, and by the values it gives me for the swapfile size ~96Mb, (my partition is this size also), it would seem to suggest that it is using the swap partition. Also, I am not able to see a swapfile created on /sdcard/ when I set this, which would further support my argument. I may be wrong though, still quite new to this.

Thanks again for your help.
[G1 Android Development] n171n:
Hi farmatito, could you please send me this file, formatted in the correct file format. I use a Windows machine so am not sure what it would do the contents. Do I need to set any particular permissions to the file when I push it into /system/etc/init.d/98-swap?

Thanks.
[G1 Android Development] joseangel.alv:
How can I change my busybox version? I mean, as xbin is a "ro" loop mounted sqf, I don't know how mount it "rw" to exchange the files... Or, perhaps, have I to copy the new version in the bin directory? :o

Sorry for my english, and thank you in advance.
[G1 Android Development] farmatito:
Copy it to /system/bin or better to /data/local

cd /data/local/
mkdir bin
cp /sdcard/busybox.bin /data/local/bin/busybox
chmod 755 /data/local/bin/busybox
ln -s /data/local/bin/busybox /data/local/bin/swapon

and call with full path in the script:

/data/local/bin/swapon
[G1 Android Development] farmatito:
Attached and untested, you may need to tweak $SWAPON.

Set permissions:

chmod 644 /system/etc/init.d/98-swap

Enjoy.
[G1 Android Development] joseangel.alv:
Tested and running... :)

I think there is one typo in the first line of your script 98-swap...

I think it must be "#!/system/bin/sh" instead of "#1/system/bin/sh"

Thank you
[G1 Android Development] farmatito:
:( ops.... :D
[G1 Android Development] cal3thousand:
If this question was directed at me:

I use a userinit script that Firerat provided, check my sig if you want to see it.

using the default swappiness of 60 and all is well right now... swap keeps about 30-40Mb free in swap.
[G1 Android Development] philosophics:
Is there any difference in battery life with/without swap enabled?

Sent from my HTC Dream using the XDA mobile application powered by Tapatalk
[G1 Android Development] n171n:
Thanks to everybody for providing the scripts that they use. I think I will go for a script that sets just the swap, and not use compcahe+swap option. That way, from what I understand, I can use the script to set swappiness to 10 with my 96Mb swap partition, and then, if required to run heavy apps (like Copilot), I can use Swapper to change on the fly.
[G1 Android Development] circusreject:
Can you quote something from Cyanogen stating he's against swap? From what I've read in the Wiki, Swap is the best of the four memory options: Stock, Swap only, Compcache only, and Compcache with backing swap... and maybe a couple other things I don't remember.... but Swap offers the best balance between performance and stability- from what I've read of the wiki, and in my personal experience.
[G1 Android Development] n171n:
firerat's swap

came across this and thought it might help for a step-by-step.

http://xdaforums.com/showpost.php?p=6374056&postcount=2029
[G1 Android Development] domenukk:
compcache

Now that we can overclock...

has anybody tried compcache set to 64 or even 90 on an overclocked cyan so far?

as compcache is basically... compressing cache, I figured it may help a lot, for example while web browsing. Should be faster to compress and afterwards decompress 2mb of ram instead of dalvik having to delete 1 mb of ram... plus it may be faster than having it on swap, especially with poor read/write rates...

seeing that cyan still runs great on 356 mhz, there is like 250 mhz left for compressing and decompressing the ram...

just thinking...
[G1 Android Development] ttabbal:
You've run CM5 at 356? Wow... I think the only time I let it go that low is when the phone is sleeping. :D I think most around here use 528, the stock chip top speed. I'm at 614, and even locked there compcache is slower than swap. Of course, I don't use a lot of swap, so perhaps that helps.
[G1 Android Development] gab1972:
Which "Swapper"? There's a paid one and a free one.
[G1 Android Development] deimdos:
free one ;-)
[G1 Android Development] Neejay:
Anyone know how to see if you actually have the swap partition (not enabled, but there)? I remember setting a 96mb swap, but after flashing a few ROMs and typing "free" into terminal, I see it set to 0. And Im wondering if it's because it's disabled in CM5 or maybe something went wrong with the partition creation :confused:

If the partition is there for swap, should it ALWAYS show up when using "free"?
[G1 Android Development] senab:
This will tell you if there's a 3rd partition on the SD card (which is usually swap)

ls /dev/block | grep mmcblk0p3

The only sure way is to reboot into recovery and go into console:

parted /dev/block/mmcblk0
print

You'll then get a load of information about the partitions on the card.
[G1 Android Development] domenukk:
or imply activate it and type free :P
[G1 Android Development] Ohsaka:
Here is the command to check how swap is enabled.

cat /proc/swaps
[G1 Android Development] Neejay:
man I need to get back on my linux. I should have known that. haha 96mb swap partition is there. Thanks!

What does that mean?
[G1 Android Development] Ohsaka:
Did something change in test3 version? The script doesn't turn on compcache for me. It looks like the ramzswap.ko file has been moved...

find / -name ramzswap.ko
/system/lib/modules/2.6.33.3-cyanogenmod/kernel/drivers/staging/ramzswap/ramzswap.ko
#

After editing the path to ramswap module..

# Compcache setup
moddir=/system/lib/modules/2.6.33.3-cyanogenmod/kernel/drivers/staging/ramzswap/

insmod=/system/bin/insmod
$insmod $moddir/ramzswap.ko
rzscontrol /dev/block/ramzswap0 --disksize_kb=32120 --init

It appears to work...

# cat /proc/swaps
cat /proc/swaps
Filename Type Size Used Priority

/dev/block/ramzswap0 partition 32112 31900 2
/dev/block/mmcblk0p3 partition 93488 0 1
# free
free
total used free shared buffers
Mem: 97772 96444 1328 0 1160
Swap: 125600 32148 93452
Total: 223372 128592 94780
#
[G1 Android Development] bm6788:
Im still a lil confused... im not a all familiar with how to use ADB. so how do i enable swap and set the swappness through the terminal? And is a class 4 s/d card (its partitioned already: 96 swap, 512 ext3 and fat32) even worth it?
[G1 Android Development] zimphishmonger:
I've personally spent this entire week playing w/ Swap, CC, and no memory enchancements on CM5.0.7-DS (test 1-3) to see the differences.

In my opinion, The phone works GREAT w/ no memory enhancement, but does get lagged down by a lot of apps, due to the lack of ram. CC at 24mb or 32mb was easily the slowest of the three, no question (which surprised me, as I loved how CC performed on SuperD).

I settled on the fact that I need to use SOME sort of swap, due help w/ the lack of ram, and found that using a swap partition w/ swappiness between 20-30 works quite well. I've found that using the 'typical' 60 swappiness results in a quick speed boost immediately, but slows down SIGNIFICANTLY after a few hours, I've been experimenting w/ lower swappiness levels, so it uses the swap as lil as possible.

I am personally using 20 swappiness right now, and might even experiment w/ 15 if I have any issues.
[G1 Android Development] bm6788:
Can you help me bro? How do i enable swap using terminal >?
[G1 Android Development] zimphishmonger:
Extract the attached zip to the root of your SD card.

Edit the userinit.sh w/ notepad++ (google it, its free and open source) to select whatever swappiness you want....I suggest between 20-30. Save the file.

DO NOT USE NOTEPAD OR WORDPAD TO EDIT, its cant save in the correct format.

In terminal, type

su
cp /sdcard/userinit.sh /sd-ext
reboot

After the reboot, you can check to see if its enabled by typing 'free' in terminal (no quotes). It should say whatever size your swap partition is under "swap". See above for examples of what shows when you use free.

Hope that helps!
[G1 Android Development] bm6788:
Thanks man
[G1 Android Development] Neejay:
hmm...then I wonder if theres even a point of swap if on a MT3G...sounds like there isn't. Seems like you noticed minimal improvement on a G1. I have a 96mb swap partition, just not active.
[G1 Android Development] ttabbal:
Hate to be the one to break it to you, but the MT3G has the same pathetic RAM amounts the G1 does. :D

It has more flash ROM, but the same RAM. You should get the same benefit/lack of benefit as you would with your workload on a G1. Just try it and see for yourself. It's easy to enable and disable, read the thread, it's only 5 pages. Personally, I find CC to be more laggy than swap, even with the overclock kernel. Just don't use the default swappiness of 60, that's way too high for a phone. I find 20 works well, I've used 10 with good results as well. If you find you get a lot of processes living too long, AutoKiller can help you tune the internal task killer in Android to prevent that.

Interestingly, I was reading about Linux kernel stuff a few days ago and there is no performance advantage to partition vs. file for swaps. So those without a partition can give it a go. Apparently, the kernel tracks where the swap file lives and writes directly to those sectors, bypassing the filesystem layer. Cool trick.

And the most important thing with swap/CC, don't make a decision until you've run with it for a day or two. It takes time for them to show how good or bad those settings can be. It can start out great, but as it loads up get VERY slow. And it depends on how you use your phone, what apps you load, etc., so nobody can really tell you what "the best" setting is. You have to figure that out.
[G1 Android Development] Neejay:
Thanks for the insight.

I currently have it enabled, with 20 swappiness. I'm assuming it's normal for the phone's temperature to be slightly raised? Feels warmer.
[G1 Android Development] lbcoder:
Your statements are pure conjecture with absolutely ZERO real measurements to back them up.

I suggest to you that if you DO actually MEASURE the difference, you WILL find that you are incorrect.
[G1 Android Development] lbcoder:
And that is a HUGE extra layer that COMPLETELY CHANGES the way memory works. Because SWAP will NOT stay empty on android. It WILL FILL UP because android won't be killing off the redundant applications.
[G1 Android Development] lbcoder:
There is a term for that.... PLACEBO.

You BELIEVE that it will do something, therefore you FOOL YOURSELF into believing that it actually DID what you figured it would.
[G1 Android Development] senab:
For me, I tried vanilla, CC, swap. CC was very slow (which surprised me quite a bit), vanilla and swap had comparable performance. The fact that my launcher didn't need to be reloaded every time I pressed the home button meant that swap is my preferred option.

Agreed, but a small swap (~32mb) and appropriate settings in AutoKiller means that Android functions as stock as possible.
[G1 Android Development] Booker-T:
How can I customize swap size and cc size?
[G1 Android Development] deimdos:
whatever dude... the only thing I can tell you is try it yourself
[G1 Android Development] philosophics:
Found out CM's new kernel won't have swap support.

Just when I was going to repartition my card to allow swap in my life, something else convinces me not to.

That and I don't want to give up performance...

This is a good thread though. A lot of information and many opinions about it.

Please try not to make this thread redundant like the rest of the threads though...
[G1 Android Development] knny1491:
That is highly disappointing. Swap is a good thing imo, especially for g1/dream users.
[G1 Android Development] vincom2:
Measure? I think sitting and watching while my music player service dies without swap and doesn't with swap counts as "measurement" for me.

But whatever. I'm here to update everyone on something else: test5 does have swap support, but if you activate it with a userinit.sh, due to some kernel changes, now the phone *really* does use the entire swap partition, not just about, say, 24/40mb (which is the behaviour I used to observe too). This is apparently new and intentional behaviour due to changes made to the low memory killer in test5's kernel, and it causes immense lag if you have swap activated on phone bootup. I suppose you could still use autokiller set to rather aggressive values to get around this. Another way I found is that if your phone is horribly laggy on boot, disable swap, then reenable it. It seems to only consume about half my 48mb partition with 20 swappiness then, which is more like how it used to behave.

However, this time cyanogen really does explicitly say that test5 is designed to run without swap, which should be unnecessary:

http://twitter.com/cyanogen/status/13983501721

http://twitter.com/cyanogen/status/13984252447

so I'm going to be trying my phone without it for these few days.
[G1 Android Development] philosophics:
I don't know what you guys/girls (don't wanna offend if there are some females presant) are doing with your devices and it's none of my buisiness.

But I have over 75 apps, I run a music app religiously and the device is constantly getting notifications.

Without swap, I have no lag. With swap, I want to throw my phone.

Why is it so hard for people to not only understand a devs point of view and recommendation, but completely ignore it entirely?

CYANOGEN SAID TO NOT USE SWAP. SO DON'T USE IT.

The fact you peeps are still going on about this is amazing. Just stop and do what the man says.

If you like swap that much, use a different rom.

I'm sorry to be rude but holy $%#& this is getting a little annoying.

14 pages of people bickering about rather or not swap is good.

THE MAN SAYS ITS BAD...

-------------------------------------

Sent via the XDA Tapatalk App
[G1 Android Development] vincom2:
I don't mean to be offensive either, but replace "a dev" and "cyanogen" with "steve"...

see? Now you sound like an apple fanboi.

As ttabbal has been saying, each of us uses our phones differently, and so we need different setups to get the best performance out of them. Ok, swap doesn't work out for you. Nobody here's forcing it down your throat; gtfo of this thread and don't read it if it's so annoying.

Swap made my phone much more usable for the whole cm4 series, and for cm5.0.7 test1-4. Now it sucks on test5, so I'm trying out running without swap. Ok?
[G1 Android Development] philosophics:
I rest my case...

Now is there any new information about swap?

If not, then what's with the redundancy?
[G1 Android Development] spongaweb:
If I have swap turned on in test 5, how exactly do I go about turning it off or do I have to reinstall the ROM again?

Can I do it through recovery console? steps please... thanks
[G1 Android Development] vincom2:
How did you activate it? A userinit.sh? If so, boot the phone normally, connect it to your computer,

adb remount

adb shell

nano /sd-ext/userinit.sh

and comment out (add a '#' in front) the two lines that look like this:

swapon /dev/block/mmcblk0p3

sysctl -w vm.swappiness xx (where xx is some number)

Then reboot (or just type swapoff /dev/block/mmcblk0p3)
[G1 Android Development] philosophics:
or

.... I think
[G1 Android Development] vincom2:
That'll only do it for the current session, if he really put those lines in a userinit.sh
[G1 Android Development] cyanogen:
Test5 shouldn't need swap to keep you background tasks happy. Swap will definitely slow you down at this point. It might be possible to improve swap behavior, but I don't think its necessary anymore.
[G1 Android Development] vincom2:
I really really hate to say this, but for quite a while now I haven't been missing smses (or at least so seldom that I haven't noticed) because I've had swap enabled. Today, without swap, I've missed at least 3 smses from friends already, and I just conducted a test. Basically I played music, opened browser and loaded about 4 windows. With 48mb swap activated at 10 swappiness I sent 15 smses to myself and received every single one in order. I then turned off swap and did the same thing. 7 smses sent, only 2 received.

:(

I *think* I managed to get a dmesg/logcat of the last miss. Posting it on the bugtracker; hopefully it's of some use.
[G1 Android Development] Booker-T:
Compcache is fast and usable in T5
[G1 Android Development] Dai323:
Thanks for your input on that man. While your around, could you comment on which EXT partition you are recommending for CM5? Everyone seems to have different answers for this, and I would really be interested in hearing what you personally recommend.
[G1 Android Development] philosophics:
Ext3 is less error prone...

-------------------------------------

Sent via the XDA Tapatalk App
[G1 Android Development] Dai323:
True that, but speed wise EXT2 is hands down winner. Im running the newest Superbad with EX2 and 128mb swap, and it FLIES. I ll try running the next version (based on test 5, as now its based on test 4) without a swap, as Im curious if test5 will be that much faster without it.
[G1 Android Development] tissimo:
I disabled the swap on Test5 per Cyanogens recommendations and had a lot of issues with the phone slowing down extremely bad after 7-8 hours of regular use.

I re-enabled swap with swapiness of 10, and well see what happens now.
[G1 Android Development] vincom2:
I'm currently disabling and reenabling swap every few hours to get around the horrible slowdowns that eventually hit when you turn it on.
[G1 Android Development] ttabbal:
I tried running test5 without swap and it did great for a day or so, then I started to get home and other background tasks killed. Turning on swap fixed it, then I had to enable AutoKiller again to keep swap from thrashing. I'm willing to try different configs, but T5 seems to still benefit from a small amount of swap. If I don't let it thrash, swap doesn't seem to significantly impact performance on my phone.

On T5, AutoKiller seems to occasionally not start on boot properly. No idea why, but I just check once in a while. I need to see if added it to userinit helps with that, I don't change the OOM settings much, so an app might be overkill anyway.
[G1 Android Development] vincom2:
What settings do you currently find best in autokiller?
[G1 Android Development] samsci:
I had compache on and phone get rebooting. Though I have to admit, I am using dumbfuq's overclock kernel. Turned off compache and no reboots. I then enabled 90 meg swap using swappiness app from the market and it has also made a world of difference.

I have seen some posts on other threads concerning Cyanogen's 5.07 Test1 - 5 which state that you can use swap, but not to exceed either 60 or 90 meg. Cannot remember which.
[G1 Android Development] cyanogen:
There is a nasty memory leak in test5 related to the camera not freeing memory when it's finished. A fix will be in test6.
[G1 Android Development] ttabbal:
I put this in userinit.sh. I believe it's the "Aggressive" preset.

echo "1536,3072,4096,20992,23040,25088" > /sys/module/lowmemorykiller/parameters/minfree
[G1 Android Development] spongaweb:
Awesome work and donated $10 to ya, never really donated in my life besides Katrina $3 but this is worth it. Keep up the good work.
[G1 Android Development] deimdos:
I've been using test5 without swap since it was released, today after an hour surfing the internet (more or less, I don't know exactly) I pressed home button and it took it a while to return home and load the icons... (I just had Twidroid running background). I'll try with swap to see how it goes
[G1 Android Development] Pfeffernuss:
And, your experience is...? ;)
[G1 Android Development] deimdos:
no problems with test versions, and no problems with final version
[G1 Android Development] kristoff123:
I have used cyan 5 a lot without swap, and with swap

I am a power user, and I do keep heavy things running in the background - music while using navigation, wireless tether while texting, etc.

I am overclocked to 633mhz, stable.

My experience is that, longterm, the G1 is faster and more responsive with swap. I can access open apps quickly, instead of waiting for them to reload all the time.

I use Swapper from the Market, 32mb file, 20 swappiness. No, it doesn't set at boot for some reason, but you can play with the settings on the fly, and I rarely have to reboot these days anyway. I recommend.

I also keep autokiller on my home screen if things ever get clogged, but with just a little swap (I don't even have a partition), my phone stays pretty smooth.

Hope that helps.
[G1 Android Development] philosophics:
Wiped EVERYTHING the other day just cause I felt like it and started from dreaimg.nbh to the pershoot kernel'd cm 5.0.7 DS stable.

Redownloaded all my apps to my 1024mb ext3 but left widgets and google apps on internal memory.

Ad Free android also helps...

THEN, I installed ADW.launcher from the market, thanks anderwebs! (Needless to say, this automagically downloaded to sd)

Things are flyin fast and I have no issues with lag at all.

Did I mention I don't use swap?

-------------------------------------

Sent via the swapless g1 running cm-5.0.7-ds cyanogen intended for users, or he would have implemented it MONTHS ago...
[G1 Android Development] Pfeffernuss:
Yup, because you're really using one app at a time. And that one app runs and loads fine, I agree.

If you're a single-app-at-a-time user running this Rom without Swap is fine. But no worry, even if you were to enable Swap you still can only run one thing at once.

Background apps will be suspended.

If that's the way you like your OS to behave, great! Others might as well have another opinion.

I'm back to SuperD, where one can really multi-task and do things simultaneously... The way *power* users like their phones ;)
[HD2 Windows Mobile 6.5 Themes and Apps] cmchan1781:
Anyone here know how to setting the incoming call with full screen image? or have application to make it full screen:confused:
[HD2 Windows Mobile 6.5 Themes and Apps] addizx:
use iconsoft, thats the dialer, or s2u2
[HD2 Windows Mobile 6.5 Themes and Apps] perern:
or YOTA phone
[HD2 Windows Mobile 6.5 Themes and Apps] scroll2:
You can try iDialer
[Hero CDMA Q&A, Help & Troubleshooting] Papa Smurf151:
Alright i know this is a simple xml edit to chang eto color of text inside the contacts but i dont know which xml file it is. i looked in common_browse_list, and common_contact_detail_list. That is where i change the background color to translucient but it says nothing about text color. someone help please
[Hero CDMA Q&A, Help & Troubleshooting] Papa Smurf151:
bump...any one that can help i would appreciate it
[Hero CDMA Q&A, Help & Troubleshooting] wtphoto:
pm Jschisurf hey seems to know a lot about the xml edit stuff and where to find it.