yashsingh1/xdaforums huggingface dataset:
[Galaxy S III Android Development] Yank555:
Yes (only if the kernel you use supports swap, that is) and yes (since it's a script put in init.d and installing a nightly will format /system, and init.d resides in /system/etc).

JP.
[Galaxy S III Android Development] lefttobleed:
hey thank you. busybox was in the wrong folder.

after changing to xbin folder swap is working. :)
[Galaxy S III Android Development] abhibnl:
Well mate i partitioned my sd-card and click apply but now my PC/mobile isn;t recognizing sd-card. In mini tool partition wizard it's showing BAD DISK, i can't create or delete partitions. Is there anyway to get my SD-card back to life? Mini tool partition wizard still showing size 3.7GB but says bad disk. Please help :(
[Galaxy S III Android Development] Yank555:
We had that once already... You need to remove and recreate the partition table (try searching the thread), can't check now from where I am...

Also important, partitions need to be primary and you need to use a card reader, not through MTP (sd card in the phone connected to PC via USB).

JP.
[Galaxy S III Android Development] abhibnl:
I exactly created both partitions as primary. One FAT32 and other Linux Swap. But after the process finished, Windows 7 asked me to format the card before using, i formatted and it's gone now. Windows isn't detecting the sd card but mini tool still showing it as full capacity but BAD DISK. No option in available due to bad disk. Any possible solutions?
[Galaxy S III Android Development] lefttobleed:
i used the phone in recovery mode to make partitions. had many problems and s3 was not recognizing the card. then used the card reader on my laptop n all is well :) so... again.... did u use the phone or card reader.

if phone, then try checking what happens with card reader.
[Galaxy S III Android Development] Tokarin:
First of all, thanks Yank.555 for this awesome mod, it helped me stop getting page reloads and app reloads when running multiple apps and web surfing. At first I had the problem of minfree killing off the apps too early before they can be put on to the swap memory, thus not utilising the swap partition fully as an external RAM kind of thing. I found that this would be possible with some tweaks around, since a class 10 card nowadays works at about 2/3 or 1/2 of the internal sd speed. So I downed the minree value, using the values from v1.0 changelog, this helped a lot along with the row I/O scheduler. Still, I'm not achieving the 10 apps running with these things, so I "stole" the app lock mechanism from bettermultitaskingfix by mattiadj that now enables me to run 10 or 13 apps without lag. The filename is "99lockapp" and the code look like this:

mount -o remount,rw /
mount -o remount,rw /system
x=1
while [ $x -le 5 ]
do
for i in `find /proc -maxdepth 1 -type d`; do
if [ -f $i/oom_score ]; then
echo "-17" > $i/oom_adj;
echo "0" > $i/oom_score;
fi;
done | sort -n -k2
sleep 4
done

Now I only have a problem with the hassle of starting apps like Search, Camera, Phone, Contacts and so want to lock them in memory, the swap memory. so I wonder if this is the right code:

mount -o remount,rw /
mount -o remount,rw /system
x=1
while [ $x -le 5 ]
do
for i in `find /proc -maxdepth 1 -type d`; do
if [ -f $i/oom_score ]; then
echo "-17" > $i/oom_adj;
echo "0" > $i/oom_score;
fi;
done | sort -n -k2
sleep 4

[COLOR="Red"]#!/system/bin/sh

sleep 60

PPID=$(pidof com.android.phone)
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID
PPID=$(pidof com.sec.android.app.camera)
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID
PPID=$(pidof com.google.android.googlequicksearchbox)
echo "-17" > /proc/$PPID/oom_adj
renice -20 $PPID[/COLOR]
done

I post this thing here in hope of any respected dev would comment on the subject, or help me fix the code if possible, or advice me if this code should be put in another file instead
[Galaxy S III Android Development] Dabarr:
Hey mate, this could be caused by your card reader. Older or low quality models are known to blow newer 64 GB SD cards sometimes. You should try out a different one :)
[Galaxy S III Android Development] Yank555:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

Not sure anymore, but I believe I used the usb dongle that came with the card... but good point taken ;)

JP.

Sent from my custom Sotmax V13 / Yank555.lu SGS3 U7 kernel v3.1d Aroma (Linux 3.0.60) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] Yank555:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

I'm not very much into that, so can't confirm deny. But from my experience in locking apps in memory, it made those get faster, but at the cost of slowing down everything else ...

But everyone need to test for the selves ;)

Btw. the speed diff. of swap needs to be compared to RAM rather than internal memory, the speed diff. is bigger than what you wrote.

JP.

Sent from my custom Sotmax V13 / Yank555.lu SGS3 U7 kernel v3.1d Aroma (Linux 3.0.60) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] abhibnl:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

Well man a little doubt still remains. When i create two partitions, fat32 and linux swap. But when i put sd card into computer again to copy my data to it, windows shows the card unformatted. Last time i clicked on format now, and next thing i know that it never worked again. So don't want to lose my new card. So what's the method to copy my data to sd card after creating swap partition? Windows always shows card is unformatted. :(
[Galaxy S III Android Development] Yank555:
There is only one proper way to do it :

1) Partition the card (one FAT32 primary partition, one Linux Swap primary partition)

2) Format the FAT32 partition (partitioning tool should be able to do that for you (Swap formating I handle in my mod)

3) Copy Files

But, always do that in a card reader on your PC (one that can handle the size of your SD card), and never try to do it using USB connection to the device, MTP doesn't give access to the card directly, so that cannot work.

Other than that, there's not much there is to say about it...

Or, if your recovery offers the option, partition the card from in there.

@All : But remember, backup your data first, it may or will (depending on how you do it) be lost !!

JP.
[Galaxy S III Android Development] abhibnl:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

Will try and report back asap. And good thing i backed up all my data. And i have original samsung sd card adapter which came with the card :o
[Galaxy S III Android Development] xtremer92:
using it on samsung galaxy captivate .....hope no prob hellybean rom.....
[Galaxy S III Android Development] Yank555:
As long as the partiton for /system and /data are the same, or if you updated the installation script accordingly, you should be fine ;)

JP.
[Galaxy S III Android Development] xtremer92:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

Kk.. every thing seems fine ....reduced swappiness to 60 ...

Whats the recomended value for swapiness?
[Galaxy S III Android Development] Yank555:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

Always kept it at 100 myself.

JP.

Sent from my Sotmax V15 / Yank555.lu SGS3 U7 kernel v3.2 Aroma (Linux 3.0.64) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] Erahgon:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

I've had a lot of lags with swap, but I guess it's a problem with my sdcard speed (it's a class 6, 64 GB SanDisk) formatted to ext4 on mmcblk1p0 and 512 MB of swap on mmcblk1p1.

Reducing swapiness to 70 or 65 seems to be a good value for me. I still have lags, but it has lessened. Any thoughts about my setup Yank? Do you think using zRam in addition to this would prove beneficial?

Details: Omega ROM v42 (XXEMR2), JKAY mod (with white listed contacts, dialer and stuff), running Perseus v32.1.
[Galaxy S III Android Development] Yank555:
Reducing swappiness should indeed help low lags on card performance issues. Set that value to whatever works best in your setup, there are no bad values, only bad values in a specific setup.

I'd not ass zram, as you will reduce available RAM for apps since you will reserve a certain amount of RAM to hold a virtual compacted blockdevice to hold swap in it.

You could also try to incread the readahead buffer size on the external SD card, that might help as well.

JP.
[Galaxy S III Android Development] Erahgon:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

Thanks! Yup, forgot to mention that too! I first thought decreasing it might help, but I'll see what increasing it will do with my setup. My use case involves listening to music stored on my extSdCard, so I hate it when it skips.

I thought that readahead was only applicable on mmcblk1p0 though?

Also tried messing around with IO schedulers. Currently trying deadline, then maybe sio. I don't think noop helped much, but I think I should sort out one issue at a time or the results will be all over the place.

My theory was that if there was lower throughput on the data partition, and if the scheduler was biased in the right way, there would be higher throughput for the swap partition.

Also, lower the swapiness would mean lowering the multitasking ability too right?
[Galaxy S III Android Development] Yank555:
When you think of it, the sysfs interface you go to to set this buffer is mmcblk1, not mmcblk1pX ;)

The scheduler as well will apply on mmcblk1, not mmcblk1pX, so the same scheduler applies for both partitions. As per definition, cfq should be the best to provide some "justice" to all the I/Os ...

Though I have no music skips, and I use 2048 ROW and my music is on the same device as the swap (external SD). I use a class 10 Samsung 32Gb sdcard.

To some extend, it will just mean memory pages are swapped out later, except if there is memory pressure, so eventually it will swap out.

JP.
[Galaxy S III Android Development] invinciblecc:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

Regarding read ahead buffer size 2048 works best

Finally enjoying s3

Yanks kernel

Sotmax v13

Zram enabled

Swap enabled

---------- Post added at 11:12 PM ---------- Previous post was at 11:09 PM ----------

Try changing your ROM to I see u r on omega42

I tried it and was facing lags so went back to sotmsx13 all well now

Try doing it it might work

Finally enjoying s3

Yanks kernel

Sotmax v13

Zram enabled

Swap enabled
[Galaxy S III Android Development] Erahgon:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

Cheers guys! Thanks for the info! So far I've not had the time to experiment with different custom ROMs, and have needed a stable daily driver. But I'll try it out when I get some free time (which should be soon now).

Ah yes! Should've looked into sysfs earlier. Makes sense that it applies schedulers across the entire disk rather than individual partitions. :banghead:
[Galaxy S III Android Development] fasters7:
i need to know how can i keep an app in memory

i searched a lot for keeping it in RAM, nothing worked

i made the swap partition, and i'm wondering if i can make an app to stay in the swap memory and don't get killed !

its really annoying that each time (after an hour or two) simple apps like messaging and phone etc. need to reopen from th begining

more annoying, the tw launcher restart

btw, thx for th great job, i really enjoyed swap on my S3
[Galaxy S III Android Development] Yank555:
You can lock apps in memory (not RAM), but an app never is swapped out as a whole (reread the FAQ I explain how that works).

Memory pages get swapped out to make room if they are not used for a certain time and/or actual RAM is needed by another app.

A memory page is a segment of 4Kbytes. So one app will have many such pages. As such only parts of an app will stay in RAM and the other part will be swapped out eventually, you don't get to make those decisions, the kernel memory management will do that.

JP.
[Galaxy S III Android Development] jeromechrome1:
Re: [MOD] How to make and use a swap partition on the SD-card (SGS3)

I partitioned my 32gb class external sd card using cwm(im not sure if the swapping was successful because it was done rather quickly after selecting options in cwm. About 0.5 secs.) and flashed your swap mod and it said no swap partition found installation aborted. I checked terminal emulator and results returned 0. Im running latest Perseus kernel. It has swap support. .Please help me get swap.
[Galaxy S III Android Development] Yank555:
Can you provide the following :

1) output in a terminal for these commands :

su

fdisk -l /dev(block/mmcblk1

cat /proc/swaps

2) poste the following files

/data/hardswap.log

Thanx, JP.
[Galaxy S III Android Development] efrant:
Closed on OP's request.
[Galaxy S III Android Development] Yank555:
Great !

And funny thing, that's exactly what I went to see tonight :D

JP.
[Galaxy S III Android Development] Yusei:
That movie blow me away!!! I can even describe that.

About the script xD

I'm with a 32Gb class10 Samsung Fat32. 1.4Gb for swap and everything without lags :)
[Galaxy S III Android Development] Yank555:
Yep, same thing, awesome movie :D

Fits the pitcure ;)

JP.
[Galaxy S III Android Development] ceo.mtcl:
+1 downloaded several times and I'm getting same error.

☞ sent from GS3 or Nexus
[Galaxy S III Android Development] shorty1483:
Now deleted the old ext4 partition and created a new 1,5TB swap using gparted, and lags are gone!

Thanks yank!
[Galaxy S III Android Development] SkzBR:
There is any possibility to use internal storage? I brought 32gb version and I think that internal storage is faster than SD cards.
[Galaxy S III Android Development] mattiadj:
Why do you think is the internal? It's too fast or too slow?

Anyway... Since I have my mod installed... I have tested my external sd :)

So what do you think about these speeds?

Ps: wow non avevo visto eri italiano. Ma sei abruzzese?

Inviato dal mio GT-I9300 con Tapatalk 2
[Galaxy S III Android Development] Yank555:
Well because the SD Tools I have, I can't choose the path of the card that gets tested, and it defaults to "/mnt/sdcard", which is the internel, so I can't test the external any way I try :(

On top of that it gives the total space / available space of the internal card as well :(

And the speed is ok, but I've a faster result in my older Sensation and my Lexart class 10 SD card.

Here are the screenshots :

Si e no ;) Sono lussemburghese, pero mamma e abruzzese, di Navelli (vicino L'Aquila).

JP.
[Galaxy S III Android Development] Yank555:
Very strange, hope I can understand at some point how this can be :( For some it works, others it just won't...

Can you try clearing cache (not dalvik !!) and then flash the mod ?

Thanx, JP.

Using a partition, no, I really don't recommand to repartition the internal storage, way too dangerous, even if it should be possible.

Plus, swap it I/O intensive, so it will wear out the part of the memory where it resides faster (have not had a broken SD card yet, but in theory it's likely this can happen), so I had rather that was some easy replacable sd card rather than internal memory the brakes.

So I do advise against this ! There are mods (even a quite expensive one on Play Store, extorsion if you ask me, for what is does !) that will create a swap-file (pagefail) and use that as swap.

Since that is a file, you can place it whereever you want, as long as you can read & write to it, so also on the internal memory.

Again, I don't advise going there !

I made such a mod on request for a Sensation user, you can give a look at it here : http://xdaforums.com/showthread.php?t=1630095

Look for "II. Soft swap".

JP.
[Galaxy S III Android Development] Yusei:
@Yank555, use antutu bench and in preferences you can choose your sdcard, then roll a custom bench with only sd card test.

I got:

External-

12mb write

18mb read

Internal-

30mb write

>50mb Read (doesn't show above 50)

Hope that helps.

You can add this tip to OP if you want ;P

Cheers
[Galaxy S III Android Development] Yank555:
Thanx, I knew that, I just prefer the way SD Tools does it's benchmarkings, I find it way more representative.

My Transcend class4 (which I have on my SGS3 until tomorrw, when I'll eventually get hold of my Samsung 64Gb) scores :

8.4mb write

5.2mb read

Which is acceptable considering the age and class, can't wait to be tomorrow !! ;)

JP.
[Galaxy S III Android Development] Yusei:
I've edited my post :)

Check it out
[Galaxy S III Android Development] Yank555:
Will add it ;)

JP.

EDIT -------------------------------------------

You just gave me the necessary push to start a FAQ, see post 3. ;)

Thanx for that, was about time I made one :D

JP.
[Galaxy S III Android Development] the_ape:
Thanks Yank, going to give this a go, Siyah kernel now has ZRam disabled (although doesn't seem to survive reboot, so worth remembering if on the 1.5b4 kernel?)

Will see how we get on with it. Oh as a side note, failed to install in CWM on mine too? just manually created the init.d script myself instead.
[Galaxy S III Android Development] Yank555:
I've noticed one strange thing, for the zram disable to stick, I had to power off my device and restart manually, rebooting cause it to not stick ?!

Damn ?! I just don't see why !? Could you check how much free space you have on "/cache" ?

Has a /data/hardswap.log been created on your device ?

Thanx, JP.
[Galaxy S III Android Development] mattiadj:
I think this mod is one of the best and necessary mod for our gs3.

With 512mb swap finally I can switch between asphalt 7, dead trigger, gosmspro and Tapatalk without any type of lag!

Also not problem at all with my ExtSd2InternalSd mod. Works amazing!

Thanks bro! I think it can be fix also the problem of launcher redraw since we have more ram free!

Only issue is with cwm zip. Not working with non touch recovery. I have to manually add the file to init.d folder and chmod it.

Thanks mate!

Inviato dal mio GT-I9300 con Tapatalk 2
[Galaxy S III Android Development] Yank555:
Hi,

I've made a few modifications to the zip flash-file.

Could please someone having had the issue of the flash not working try the one attached here ?

NB: No change to the mod, just to the flasher due to it not working for everyone.

Thanx, JP.

PS: I've tested it on mine, worked fine.

Download link : http://xdaforums.com/attachment.php?attachmentid=1243292&d=1344186829
[Galaxy S III Android Development] Mopral:
I had the issue with your previous zip file but this one works without error

Thanks!
[Galaxy S III Android Development] Yank555:
Thanx for testing :D

JP.
[Galaxy S III Android Development] Mopral:
For the LMK setting, I think this is an issue with ICS

Look at "thunderbolt tweaks" thread in general android. I use this tweak and it works even after reboot. You need to write the settings in /system/build.prop or /data/local.prop (can not remember which one) to make them stick

But please make it optional because some people already use modified LMK settings
[Galaxy S III Android Development] Yank555:
Thanx for the hint, will look into that direction ;)

And I'll make it optional, maybe using Aroma Installer ... as soon as I find a little time. Looking into compiling the kernel on my own right now, might take me a little time ;)

JP.
[Galaxy S III Android Development] Mopral:
if it could help you to make your own, here is the zip file from thunderbolt that wrote values in prop file
[Galaxy S III Android Development] beautyangel:
Help needed Sir.

Great job yank555, thanks for your MOD buddy.

64gb class 10. Omega 11. Install Siyah-s3-v1.5beta4-CWM. Install "mattiadj" " [MOD]ExtSd2InternalSd v3|Increase your data storage|CMW zip"

"Mod for exfat Sd Card for stock kernel with init.d support"

Just put copy zip on sdcard.

Using CWM 5.5.0.4 cf V1.5

followed instruction :

Got E:error in sdcard/applications omega rom modded/Hard-swap-yank555.lu_flasher-v1.0. zip (status 0) installation aborted

I wipe nearly all thing, reformat 64GB sdcard, format 32GB internal memory.

Reinstall omega 11 rom and Siyah-s3-v1.5beta4-CWM.

I need "mattiadj" " [MOD]ExtSd2InternalSd v3|Increase your data storage|CMW zip"

"Mod for exfat Sd Card for stock kernel with init.d support"

And I want to [MOD] How to make and use a swap partition on the SD-card" to have more memory.

Help needed. thanks for all.

Best Regards.
[Galaxy S III Android Development] Mopral:
Download new v1.0a and you should have no issue anymore
[Galaxy S III Android Development] beautyangel:
thanks mopral But not working

gonna give a try and give feedbacks. re formatting in exfat my 64 gb SDCARD.

install omega 11.0

install kernel siyah s3-v1 5 beta 4 cwm

install hard swap yank555.lu 1.0a

- mounting system partition

- mounting data partition

- extracting installation files

- starting installation script

Problem, no swap partition found !

--> Installation aborted.

- removing installation files

- unmounting partition /data

- unmounting partition /system
[Galaxy S III Android Development] Yank555:
Can you post the result of the following command in a terminal :

su
fdisk -l /dev/block/mmcblk1

Looks there's sth wrong with the partitionning of the SD card.

JP.
[Galaxy S III Android Development] beautyangel:
how to do this command buddy.

Yank555 how to do this buddy. with samsung galaxy s3 tool.

Can you post the result of the following command in a terminal :

Code:

su

fdisk -l /dev/block/mmcblk1
[Galaxy S III Android Development] Yank555:
You need a terminal, like this one available on Play Store.

When you start it, just type the commands.

JP.
[Galaxy S III Android Development] beautyangel:
here goes for the command

Can you post the result of the following command in a terminal :

Code:

su

fdisk -l /dev/block/mmcblk1

fdisk: invalid option --1

busybox v1.20.2 stericson
[Galaxy S III Android Development] Yank555:
It is not a " 1 " but a lowercase " L " ;)

JP.
[Galaxy S III Android Development] graffixnyc:
I partitioned my card. I have a 512 primary Linux swap (I used minitool)

I'm running siyah 1.5b4

flashed the mod zip and seemed to go fine but when I type free in terminal I get sh: free not found

also if I type cat /proc/swaps it's blank

Any ideas?
[Galaxy S III Android Development] Yank555:
What ROM are you running ? Free is a command that should be installed with the ROM (part of busybox).

Maybe try updating busybox, there's an excellent app available on PlayStore.

Since free is missing, maybe swapon is missing, too, and as such swap would not get activated at boot.

Try typing this in a terminal :

su
which free
which swapon

JP.
[Galaxy S III Android Development] graffixnyc:
I'm running the stock Samsung rom LG8.

Also I have busy box installer I checked that and I have version 1.20.1

When I type which free at the term (after typing su) I get which not found.

I also verified BB was installed by typing busybox and it listed all the commands and I see both which and free there so hmmm

edit: When I type "busybox free" it works, but it's showing thr swap as zeros:

edit 2: I did come from a stock kernel and didnt have an init.d folder so the script wasn't being copied over. Once I created the init.d folder I reflashed and now the script is there but busybox free is still showing me zeros for swap
[Galaxy S III Android Development] Yank555:
What is missing are the symlinks, pointer for commands towards busybox :(

If you will, usybox is some kind of swiss knife, so depending on what you'd rename it, it would do different things.

ROM installation scripts would create what is calles symbolic links for each command...

If you like stock, it would probably be a good idea to have a look at ARHD ROM.

Or at least install the free busybox app from Google Store and let it install those links for you...

JP.
[Galaxy S III Android Development] graffixnyc:
Thanks, just reinstalled busy box with the normal busybox app (not the BB installer app) and it re created the symlinks for me and now free works and is reporting my swap :)

Thanks man!