yashsingh1/xdaforums huggingface dataset:
[Galaxy S III Android Development] Geo1997:
multitasking depends of the free ram available. You'll have a better multitasking with 300mb free ram than 100mb free ram.

Swap is used more and more when you open apps on your phone. Don't know exactly how it works, but you'll not have 300mb free ram more just like this.

AutoMemory Killer limits the phone at a minimum free ram to avoid lags ;)
[Galaxy S III Android Development] mattiadj:
I have tried. Surely I don't have lags with strict but use of swap and multitasking is not really good.

Opened dead trigger Tapatalk and gosms and dead trigger was killed.

I'm trying moderate preset now

Inviato dal mio GT-I9300 con Tapatalk 2
[Galaxy S III Android Development] Geo1997:
Everyphone and way of use it have its own settings ;)
[Galaxy S III Android Development] hshah:
Playing Asphalt and the phone starts lagging due to the swap. What do you guys suggest?

Sent from my GT-I9300
[Galaxy S III Android Development] Geo1997:
Why do you think it's a problem with swap ? Maybe your kernel...

For me, No prob for Asphalt 7 and SWap
[Galaxy S III Android Development] hshah:
I'm running the latest Siyah.

The phone lags a lot until I go and close other apps and then run Asphalt. Also after playing Asphalt I have to kill the game or the phone lags.

Sent from my GT-I9300
[Galaxy S III Android Development] jnr21:
Which speed class your card is?
[Galaxy S III Android Development] hshah:
SanDisk Class 10

Sent from my GT-I9300
[Galaxy S III Android Development] mattiadj:
I have problems of lags too.

I thinks we have to play with lmk values

Inviato dal mio GT-I9300 con Tapatalk 2
[Galaxy S III Android Development] Mopral:
Launch Asphalt 7, Riptide GP and Modern Combat 3 and keep them running without any lag...
[Galaxy S III Android Development] jnr21:
Ok, so it's not too slow then :D
[Galaxy S III Android Development] Geo1997:
Yep, i think we have to play with lmk values :/
[Galaxy S III Android Development] rezapatel:
Am using Optimum on AKMO and I think this is the perfect balance I found for my usage.

Don't feel any major noticeable lags, and having 91 MB free at all times keeps the phone almost snappy.

Thanks!
[Galaxy S III Android Development] mattiadj:
What is akmo?

Inviato dal mio GT-I9300 con Tapatalk 2
[Galaxy S III Android Development] jnr21:
https://play.google.com/store/apps/details?id=com.rs.autokiller
[Galaxy S III Android Development] mattiadj:
Lol! It's app I'm using!

Inviato dal mio GT-I9300 con Tapatalk 2
[Galaxy S III Android Development] rezapatel:
Sorry, many out there that do the same. But I have always trusted Auto killer Memory Optimizer (AKMO) and Ram Manager Pro by Juwe (he was probably the first ones to tweak the minfrees as a script, now an app).

Probably the benchmark in script based minfrees is now the V6 by Zepp. Not using that at the moment and happy with AKMO.

Cheers and happy weekend to all.
[Galaxy S III Android Development] hshah:
I was under the impression we shouldn't be using task killers on Android?

If we use task killers what's the point of swap?

Sent from my GT-I9300
[Galaxy S III Android Development] btemtd:
exactly!!

Why are people killing there apps? Android should be doing this automatically for you when in need. If I go inside a high graphic game and i play for about 2 min in then i quickly exit the game and go look ram manager i have almost 400mb ram. which means android has killed all the neccasary apps needed to run game smooth
[Galaxy S III Android Development] hshah:
I'm thinking my lagging is caused by this script moving things to swap in order to play the game.

Sent from my GT-I9300
[Galaxy S III Android Development] jnr21:
AKMO isn't task killer, it's an app that allows you to change androids internal minfree values, but there is also feature that allows you to kill processes and services, but i use it only for minfree tweaking.

I agree that basic task killers are bad on android because android manages task killing itself, but with akmo you can change those internal values, so there's not any 3rd party task killing services running.
[Galaxy S III Android Development] Geo1997:
It's not a task killer. These apps are playin with the minfree ram values.

You says : " Android should be doing this automatically". This app changes the way Android kills automatically the process and services. So it can't be less or more strict ;)
[Galaxy S III Android Development] hshah:
Ahh right. That makes more sense then :)

What settings are recommended?
[Galaxy S III Android Development] Geo1997:
;D

It depends of you, your phone and the way you use it.

I would have start with Optimum. If the phone lags sometimes, go to strict. If the multitasking is not good enough, go to moderate ;)
[Galaxy S III Android Development] fekle:
Hello, first of all I have to say thank you, nice thread!

I've also tried to use your script for making use of my swap partition, however without success.

I've got a 64 Class 10 microSDXC from SanDisk, which is working wonderful. I used iPartition on mac to make a 55GB Fat32 partition and a 4GB Linux Swap partition. Everything worked fine, so I inserted my card, booted into recovery and flashed your recovery. It says partition found, and everything is working perfectly, Installation is finishing without any issues.

However, when I reboot my system, go to Terminal and type "free" I get "0 0 0" everywhere in the Swap line :(

I'm using CM10 Baconwarmer (8/22) with Siyah 1.5.2...

Can anyone help me?

Cheers
[Galaxy S III Android Development] Mopral:
Make sure that busybox is installed in /system/xbin (siyah put it in another folder...) as it is needed by the script

If it's not there, just use busybox app from Stericsson on play store to install busybox in the right folder
[Galaxy S III Android Development] fekle:
Yeah, thanks, however, I already used Stericsson's Busybox app, and the busybox actually has been installed in /system/xbin, however I uninstalled it and reinstalled it into /system/xbin, it worked well, but after reflashing the swapscript it still is not working :(

Maybe the newest version of Siyah doesn't support SWAP anymore?

cheers
[Galaxy S III Android Development] fekle:
Here's a Screenshot:
[Galaxy S III Android Development] Mopral:
Siyah 1.5.2 support swap: it is what I use on my phone

Maybe something with your rom:

-any tweaks included in it?

-any script in init.d that run after the swap one?
[Galaxy S III Android Development] Nichie:
Did you set both partitions to primary?
[Galaxy S III Android Development] fekle:
I'm running CM10 with the Onscreen buttons mod.

Yep, both are primary, as I say the script recognises the partition! :/
[Galaxy S III Android Development] btemtd:
-=Minfree=-

Isnt that just forcing android to close apps to have this much free ram otherwise howelse is it getting extra ram... and u would think its closing the apps itself Because unless you change the way android works android will only restart these apps again, which then causes more lags because you have close and open and close and open.

Is this software really that sophisticated to change androids ram management.

Have you noticed when you close some apps yourself you go back in there and the apps restart? that depends on the apps, I would think that the software would not know which apps are going to auto restart or not as it may be different on different phones and in that case it will cause lags as the apps are restarting.

just a thought mayb im wrong , Just by hearing about it I would think thats how it works. I would be curious to find out how it does work, if it doesnt work in the way above
[Galaxy S III Android Development] fekle:
So, I repartioned my emmc once again, with the swap partition as primary on the end of the card... However it still doesn't work :(

So i decided to have look at the log (alogcat) and found this: (attached image)

Any idea what the problem could be?

Cheers
[Galaxy S III Android Development] Geo1997:
I don't exactly understand your post.

What i think :

Minfree are values in Android that stop apps if they are above the limit. Because if the freeram is too low the phone lags.

But if there is enough free ram available and you open a first app and then another app, the two apps are still open like on Windows.

If the freeram is not enough, Android will close the first app, open the second and restart the first one when you come back on it.

We have to play with the ram available (we use swap to have more) and the minfree values, to have a good multitasking and no lags ;)

Envoyé depuis mon GT-I9300
[Galaxy S III Android Development] rezapatel:
You might want to check zram is disabled on Stweaks app on Siyah.

It could possibly be a limitation of CM10.

You might also want to try the manual script to activate in the earlier posts by Yank on this thread.

Please make sure to back up before trying out the manual script.
[Galaxy S III Android Development] daniel9522:
i keep getting this please help

thanks in advance :)
[Galaxy S III Android Development] Mopral:
Install Stericson's busybox app from play store and use it to install busybox in /system/xbin folder
[Galaxy S III Android Development] Yank555:
Maybe you would have found out a little more if you had cared to read on, up to the 3rd post, which is called "FAQ" ;)

More specifically this question "

What is the benefit of this mod ?

"...

JP.
[Galaxy S III Android Development] Yank555:
Class 6 will do, class 10 may be better. It will always depend on the specific card, I have seen very strange benchmarking results with cards supposedly of the same speed !?

For instance I have a Transcend class 4 which gives me almost the same speed as a different brand's class 10...

I can recommend the Lexar 32Gb class 10, it works great for me.

JP.
[Galaxy S III Android Development] Yank555:
By the way this is what I have after a little less than 2 days uptime :

su:/mnt/extSdCard>cat /sys/module/lowmemorykiller/parameters/minfree
8192,10752,16384,21504,28672,32768
su:/mnt/extSdCard>free
total used free shared buffers
Mem: 797792 742364 55428 0 1756
-/+ buffers: 740608 57184
Swap: 522108 133148 388960
su:/mnt/extSdCard>uptime
up time: 1 days, 15:36:11, idle time: 2 days, 08:32:49, sleep time: 1 days, 00:13:04
su:/mnt/extSdCard>

JP.
[Galaxy S III Android Development] btemtd:
Thanks for the explanation on Swap And ALMK...

The above attachment, Does that mean the longer your phone is on the more swap is used?? Does that mean you need to reboot when swap gets full? I dont get it,,

And in that explanation is ALMK settings equal to Minfree settings???
[Galaxy S III Android Development] Yank555:
The longer you run your system, the better swap will get used, since all the blocks that don't get used in apps will be swapped out, and you will have run all of your 'usual apps'.

This does not mean swap will get full or that it will overflow or whatever, Linux virtual memory manager handles this. When you run an app the bits that you actually use

must

reside in RAM thus will

never

be swapped out. Plus as soon as you use another part of that app, the needed blocks will be swapped in again, thus releasing space in swap and using RAM again.

So there is no need to reboot your system either, what I just want to point out is that you just can't boot and check swap usage right after boot and wonder why almost no swap is used, that is absolutely normal.

Yes, the minfree sysfs interface file

is

the LMK setting ! ;) (it's in number of pages per category)

JP.
[Galaxy S III Android Development] btemtd:
Thanks for that, I have tweaked my phone And Im using Foxhound 1.4.4 And siyah Kernel, I overclocked to 1704mhz ANd done a few GPU tweaks.

And your swap ram Mod was the Icing on the cake. My phone Is soooo Buttery smooth now.

I am getting constant 7000 benchmark results it is SO SO stable the results are very similar each time I do it. thank you very much

I wonder why samsung did not add more ram or think of doing a hidden swap partition in the phone
[Galaxy S III Android Development] Yank555:
Oh well, I'd really have loved to have 2 Gb RAM or even more :D
[Galaxy S III Android Development] btemtd:
i wonder why they didnt think of the swap concept
[Galaxy S III Android Development] jnr21:
I bought sandisk class 6 card and it seems to work fine.
[Galaxy S III Android Development] Yank555:
I suppose for the general public leaving swap out makes it easier and the device is good enough for average use ...

... then come us, the nutcases, who just want to get more out of it :D
[Galaxy S III Android Development] oluwaponmile:
Would this swap partitioning work on jelly bean rom?
[Galaxy S III Android Development] Yank555:
Yes, given these two conditions :

1) kernel has virtual memory management compiled in (swap support)

2) ROM or ramdisk support for init.d scripts

But since there are not yet kernel sources for Samsung JB, I don't think you will find a kernel with swap support...

JP.
[Galaxy S III Android Development] jnr21:
Working great with cm10 jelly bean and siyah kernel, sammy jb roms doesn't have kernels which supports swap yet.
[Galaxy S III Android Development] oluwaponmile:
Thank you guys for your responses, I will have to wait until there is a custom kernel for sammy jb.

@jnr21

Just of out interest, is CM10 rom any better than sammy JB?
[Galaxy S III Android Development] jnr21:
It's faster and smoother than sammy jb but there is some mem leak problem on some users. If you don't need touchwiz and it's apps, try cm10, i use it as daily driver.
[Galaxy S III Android Development] Erahgon:
That'd be interesting right? Memory Leak, meet Swap Partition. Swap Partition, would you please take Memory Leak around the back and deal with him... :p

On a more troubleshooting related note:

I am on Siyah Kernel 1.5.2, running Stock DDLH1 (INU).

Busybox v1.20.2 has been installed to "xbin".

I booted up and saw that when I typed "free" in the terminal, I got the dreaded swap 0-0-0 result.

I looked through this thread and came across the debug list (added corrections):

su
free
uname -a
cat /proc/swaps
swapon /dev/block/mmcblk1p2
ls -l /system/xbin
free

Actually, I first typed in the wrong code, but I saw the corresponding post with the corrections and re-typed "swapon /dev/block/mmcblk1p2" and then checked the result using "free". Lo behold! I had an activated swap partition!

My question is: Do I have to do that manually every time I boot up? I thought that Siyah kernel came with init.d support.

This mod kicks ass! Thanks a lot Yank555 and all who contributed!
[Galaxy S III Android Development] oluwaponmile:
Thanks for the info.

I think I wait it out until the memory leak fix could be fix
[Galaxy S III Android Development] fekle:
Hi everyone! I just formatted the system partition and reflashed everything. However I still don't have any swap.

So i decided to try around a bit. If I type

mkswap /dev/block/mmcblk1p2
swapon /dev/block/mmcblk1p2

into the terminal it works and I have swap... However I only have 4MB swap while the partition is 4 GB in size... However I also had a look at the log of Yank555 script, maybe someone can figure out what my problem is? :

SD-card swap partition has been found ... good !
SD-card swap partition device is present as well ... excellent !
------- SD-card partition table ------

Disk /dev/block/mmcblk1: 63.8 GB, 63864569856 bytes
4 heads, 16 sectors/track, 1948992 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk1p1 1 1817920 58173416 c Win95 FAT32 (LBA)
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk1p2 1817921 1948992 4194304 82 Linux swap
Partition 2 does not end on cylinder boundary
------- before activating swap -------
total used free shared buffers
Mem: 797384 33248 764136 0 4400
-/+ buffers: 28848 768536
Swap: 0 0 0
--------------------------------------
FilenameTypeSizeUsedPriority
-------- activating swap now ---------
- swapon /dev/block/mmcblk1p2
- setting swappiness to 100
------- after activating swap --------
total used free shared buffers
Mem: 797384 33204 764180 0 4400
-/+ buffers: 28804 768580
Swap: 0 0 0
--------------------------------------
FilenameTypeSizeUsedPriority
--------------------------------------

Im still confused why my swap isn't working :(

Cheers
[Galaxy S III Android Development] mattiadj:
Guys probably I have finally found a very good min free values for a hight multitasking level with zero lags!

I have 300mb swap.

Set min free values as in picture.

I have made a lot of tests and I was able to play together with Tapatalk, gosms pro, dead trigger, fifa 12, Facebook and email. I think is enough!!!

Give me feedback please!

Best

Inviato dal mio GT-I9300 con Tapatalk 2
[Galaxy S III Android Development] rezapatel:
Thanks - Changed to these, will share the results soon. Even though optimum worked pretty well, did have occasional multitasking issues.
[Galaxy S III Android Development] hoangtu2410:
Thanks for the mod, tried yesterday and i feel the phone smoother now . Sorry for my question if anyone ask it before : is there anyway to have this mod and the extsd2internalsd mod working together :crying:
[Galaxy S III Android Development] Yank555:
Hi,

Yep I thought as well Siyah took care of it...

Can you see "/data/swap.*.log" files ? If so, can you post it (them) ?

JP.
[Galaxy S III Android Development] Yank555:
Hi,

Can you type this in a terminal and post the result ?

su
/system/xbin/swapon /dev/block/mmcblk1p2
swapon /dev/block/mmcblk1p2

JP.
[Galaxy S III Android Development] mattiadj:
Any problems about this. You can use these mod together. I'm using these together without problems or any particular setting

Inviato dal mio GT-I9300 con Tapatalk 2
[Galaxy S III Android Development] jnr21:
I just flashed wanams latest jb (based on latest sammy jb leak lh7), and it's feels much smoother (transition anims and scrolling, contact is still a bit laggy) than cm10, i think that hwcomposer is fully working on sammy jb now.
[Galaxy S III Android Development] Erahgon:
Hmm... curiously, it works now even when I reboot!

I have attached the files nonetheless! Thanks for the help!

http://db.tt/lRaliMAP

The XDA app doesn't allow the posting of files, only links and pics. So that the link to a dropbox folder.

[Edit] Had a look through those files myself, and everything seems to be in order now. I set swapiness to 75 cause I thought it would favor RAM more than SWAP. Any thoughts on a good value?

Also, I think the problem may have been due to the fact that I may have installed the script before I installed Siyah kernel (i.e. through just CF-ROOT). So after I had installed Siyah kernel, I had to do the commands manually to activate SWAP.
[Galaxy S III Android Development] Yank555:
Great, glad it works ;)

JP.
[Galaxy S III Android Development] rezapatel:
This one made me experience a few lags. My new settings and around 8 hours of testing and it's fantastic so far, multitasking and the snappiness.
[Galaxy S III Android Development] mattiadj:
How is big your swap partition mate?

Inviato dal mio GT-I9300 con Tapatalk 2
[Galaxy S III Android Development] rezapatel:
550 MB. But I am using a class 4..

---------- Post added at 08:36 AM ---------- Previous post was at 08:29 AM ----------

Tweaked and played further and attached screen shot with the new changes..
[Galaxy S III Android Development] hshah:
I've had to uninstall this as every now and then the phone grinds to a halt and I have to manually clear the RAM.

I did try various settings and did make sure I had a fast SD card, but no avail. :(

Sent from my GT-I9300
[Galaxy S III Android Development] jmgg2k:
till now, the best settings for multitasking without lag. Thanks
[Galaxy S III Android Development] hshah:
Mine ground to a halt regardless of my settings. I tried all recommended ones in this thread.

By the way mine is SanDisk Class 10, and swap was 1GB.

Sent from my GT-I9300
[Galaxy S III Android Development] Yank555:
What kernel / ROM were you using ? I'd like to learn from the problem.

JP.
[Galaxy S III Android Development] hshah:
I'm using the the latest Siyah and Wanamlite 2.2 :)

Sent from my GT-I9300
[Galaxy S III Android Development] Yank555:
That would be SiyahKernel S3-v1.5.2 ?

Strange, I thought that should only potentially happen with kernels that uptdated to kernel.org 3.0.39 or more, but GM reverted to stock 3.0.15 ...

I've made myself a 3.0.38 close to stock kernel with the same mods I had on my 3.0.41, with which I sometimes had a little lag, but never as bad as you described.

I've been running this 3.0.38 kernel (it's my v1.0.38a) for one day now, as I only made it yesterday, so far very smooth, will see with longer uptimes.

JP.
[Galaxy S III Android Development] hshah:
Yeah that's the kernel. To be honest it must be something on my end as no one else had reported what I'm experiencing, but I can't seem to figure out what it could be. :(

Sent from my GT-I9300
[Galaxy S III Android Development] Nichie:
Tried reducing swap to 512mb or 256mb?
[Galaxy S III Android Development] Erahgon:
I had this happen too actually. But my minfree and lmk values were bad I suppose.

I used the v6 supercharger script and set new values and now my device soars!

Keep in mind that the defaults in the v6 supercharger are not optimized for use with SWAP. I think I shall pay with the values given a few posts back and see how it goes.
[Galaxy S III Android Development] rezapatel:
Hey Yank, I am still waiting for your stock Kernel with swap support out of the box ;)

No hurries but thought I'd share because I would love to try the stock too for a while.

I too still have bad moments during the day with the kernel / rom I am using. And I would think the culprit could be the over tweaked Siyah kernel.

Thanks!
[Galaxy S III Android Development] Yank555:
The version with init.d support out of ramdisk will need a few hours work, need to add full busybox to the ramdisk first :(

If you can add the few lines to "/system/etc/init.post_boot.sh" I posted a few days ago, you can use all of the kernel versions in my batcave (link in my signature, click on the kernel version), I'd recommend 1.0.38a or 1.0.41a as those two have faux's network boost goodies included.

If pure stock with swap support is what you want, 1.0 is a pure Sammy 3.0.15 with just that.

The other ramdisk with init.d support is a priority in my todo list for me as well, but I can only do that if I know I have several consecutive hours at my disposal, it's just a PITA to stop in the middle of sth. like that ;)

JP.
[Galaxy S III Android Development] rezapatel:
Hey Yank. I changed the kernel to Franko and seems like this one doesn't support swap out of the box neither.

I was trying to add the solution you suggested to enable the init.d folder but can't seem to find the file init.post_boot.sh in /system/etc/

Any ideas?

Thanks!
[Galaxy S III Android Development] eiraku:
I'm having it here too, as soon as I hit below 100MBs free RAM.

So yeah, it's not just something on your end.

TBH, I never got around to shrinking my huge 1.5GB swap partition so that might just be it.
[Galaxy S III Android Development] Yank555:
Most important and first tning to check is if the kernel has swap support by activating the partition manually. In a terminal type :

swapon /dev/block/mmcblk1p2

If it says 'not supported' you can stop there :(

If that works, we need to check your ROM / kernel combo for init.d support and/or busybox installation.

JP.

Sent from my custom ARHD 2.1.1 / Yank555.lu kernel v1.1 (Linux 3.0.42) powered Samsung Galaxy S3 using xda premium
[Galaxy S III Android Development] Yank555:
If free RAM drops so low (where do you check this btw ? Depending where you get different results), I'd say better review your LMK setting and use higher values.

IMHO, 256Mb is enough as swap, 512 if you can spare them (I've been too lazy to resize mine to 256 yet :))

JP.

Sent from my custom ARHD 2.1.1 / Yank555.lu kernel v1.1 (Linux 3.0.42) powered Samsung Galaxy S3 using xda premium