yashsingh1/xdaforums huggingface dataset:
[Galaxy S III Android Development] Yank555:
If you use my kernel (with hardswap included), then you won't find anything in init.d as I run hardswap out of the ramdisk that comes with my kernel (through /system/etc/init.kernel.sh --> /system/etc/init.hardswap.sh), so not seeing the script in init.d is normal in that case.

Also, if when flashing the mod (or the mod through flashing my kernel), no swap partition can be found (for whatever reason), the script will not be installed, so in those cases again it's normal not to find a script.

What you can do so I get an idea of what may be going wrong is to post :

/data/hardswap.log (should be present in any case)

/data/swap.0.log (will be present only if at least the script is installed and run at boot, even if swap's not working)

And maybe also tell us what ROM / kernel you do actually use (I mean the one you'd eventually like to use the mod with, not those you tested just to debug your issue).

JP.
[Galaxy S III Android Development] ginodp:
Here is how to do it.

Make a nandroid (recommended better safe then sorry)

Create a Linux Swap partition of 254 or 512 mb on your SD Card and make sure it's Primary. (U can use Minipartition home edition Link)

Create the directory "init.d" in System/etc/ on your device and make sure it has the permission is rwxr-xr-x

Install the latest busybox by Stericson (Play store download) (Make sure its installed in "system/xbin" )

Then install "Hard-Swap-Yank555.lu_Flasher-v1.1.zip" Download This is the download link from first post

And your good to go.

Thanks to Yank555
[Galaxy S III Android Development] Geo1997:
Hmm okk :) I'll search

Oh... since I install swap, I got some lag while waking up phone and touching screen with the water effect ...

And Is it possible to have a list of apps which currently on swap ? And make that an app don't come on swap ?
[Galaxy S III Android Development] makalolo:
hye yank just wan to ask you I already flash it can you confirm below attached its working or not
[Galaxy S III Android Development] FernandM:
After reading your reply, I reflashed the package and noticed that the swap partition was not being found (As you said)... So I figured I didn't partition my sdcard right. Did it again and now it works! Thanks a lot! I needed this bad since I'm a heavy multitasker and the lack of ram is frustrating.
[Galaxy S III Android Development] Yank555:
Due to the performance difference between swap (in this case your SD card) and you RAM, you may indeed experience litlle lags, this is whan swapping in becomes necessary. But I must admit it is really very rare on my card / phone combo with my usage pattern.

But this can be more or less important, and in in your usage pattern you get too much of this, you'd probably be better off not to use hardswap, but unfortunately there's only one way to find out and that is to test it as you are doing.

There is no list of apps on swap, as it is not an app that is swapped out, but a memory page (which in Android is a 4Kb block), and as such it is just a tiny bit of an app.

I've tried to explain that in the faq here :

JP.
[Galaxy S III Android Development] Yank555:
Yep, it's working.

Btw, the second command is "cat /proc/swap

s

" ;)

JP.
[Galaxy S III Android Development] makalolo:
Thanks mate!:fingers-crossed:

but when i try the command cat /proc/swaps got some error

( sh: can't create cat: read-only file system )

any advise?

BTW i got it.. :)
[Galaxy S III Android Development] Yank555:
Wow, that's odd, "cat" is used to read a file, and it isn't supposed to create anything ?!

JP.
[Galaxy S III Android Development] fatthumb:
Finally managed to get this up and running. I used it on Wanam 5.1. Those that are having problem can double check the partition type again, mine was showing linux swap but when I tried to assign new partition type, the initial type was shown as fat32.
[Galaxy S III Android Development] makalolo:
Hye Yank,

I have been using your swap about 2 days but my ram free only 200mb ~ 120 mb

i cant find where to unable Zram any advice?
[Galaxy S III Android Development] Yank555:
Well that will depend on how it is activated ...

Do you see anything looking like "...zram..." in /system/etc/init.d ?

JP.
[Galaxy S III Android Development] xclub_101:
One unusual thing ...

I am using WanamLite 5.1 (ELKC) and Siyah kernel 1.8.4 and I activated the swap and it still works (it worked well before with Criskelo v18 and an old Siyah 1.7 beta3 or so).

HOWEVER there is a difference - with the new configuration the swap becomes in time far more used (about 200-300 MB out of 512, before was mostly under 50MB) and as such the performance plummets - so I had to disable it :crying:
[Galaxy S III Android Development] makalolo:
kindly refer below attached...please advise ...do I need to delete any scripts ?
[Galaxy S III Android Development] Yank555:
The problem indeed is that hardswap can help but can also induce lags :(

On ARHD I used 256Mb swap just fine, never had a stutter, but on PA-CM10 I sometimes have slight lag, and occasionally bad lag for a few seconds, so I sometimes enable and sometime disable it :rolleyes:

If it gets used too aggressively, it will slow you down.

You could try to play with swappiness, setting it lower than 100 to use swap less ... (haven't had the time to play with it so far to test the effects..)

JP.
[Galaxy S III Android Development] Yank555:
Could you zip your hole init.d and post it ? So I'll have a look...

JP.
[Galaxy S III Android Development] makalolo:
Here you go mate...
[Galaxy S III Android Development] Yank555:
zram is not activated by one of these scripts ...

If you run ARHD, might be in /system/etc/init.post_boot.sh ...

Or the kernel (ramdisk in fact) activates it. In this case you could add a script that disables zram in init.d

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3 Aroma (Linux 3.0.54) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] makalolo:
how to add the scripts? can you make the script I can try
[Galaxy S III Android Development] Yank555:
You can simply make a script like this :

#!/system/bin/sh
swapoff /dev/block/zram0

Put it in a file, call it "99nozram" (or whatever you prefer after "99"), copy it to "/system/etc/init.d", and give it proper permissions (rwxr-xr-x).

Once you reboot, zram should get disabled.

It's not a very clean situation, though, but it should work.

JP.
[Galaxy S III Android Development] makalolo:
i will try and report later thanks mate:D

Edit : already make the file and move to int.d folder but how can i check the scripts working or not?

Edit2 : i think its work when i reboot i got 350 ~ 400 mb free ram and when i open fb,whatapp,talk,crome etc.. i got 320mb of free ram thanks mate
[Galaxy S III Android Development] Geo1997:
Ohh. I had some problems with my mic after installing the swap ram.

I uninstall it and it's working like before.

Don't know why ...

Envoyé depuis mon GT-I9300
[Galaxy S III Android Development] Yank555:
Mic probs due to swap ?? Very odd...

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3 Aroma (Linux 3.0.54) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] Yank555:
To check if it's working, type :

cat /proc/swaps

If a device /dev/block/zram0 is listed, it didn't work, if no such device is to be seen, it's working.

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3 Aroma (Linux 3.0.54) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] Geo1997:
Don't know exactly.

Just that I had a problem with the mic when swap ram was installed. I will try again after reflash the rom and kernel.
[Galaxy S III Android Development] Yank555:
Keep me posted, please ;)
[Galaxy S III Android Development] ginodp:
My phone gets very slow allot. It needs time to load very long. Then when i kill all the apps that are open, its back to normal. Can that be because I use a class 4 8gig sd?

My settings are:

Paranoid droid

your kernel settings yank

Your swap with 512 mb

Class 4

8 gig

Writing speed 5mb

Reading speed 17.1 mb

Test with SD Tools
[Galaxy S III Android Development] Yank555:
Yep, card speed will have an impact, also 512 might be too much ...

I'm testing swap on my PA, and it does behave differently on CM10 than on Sammy base...

For now it seems to behave better with 256Mb (always had this amount, though) and swappiness set to 70. And I use a class 10 Samsung 32Gb card.

But I'm still experimenting...

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3a Aroma (Linux 3.0.56) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] ginodp:
OK that was my thought also. The SD is to slow. Going to get a class 10 32gig also. And change to 256 mb.

I'll keep your kernel settings and keep you posted.

Thanks
[Galaxy S III Android Development] TrickyTown:
Its work on Galaxy Ace Duos S6802..:D
[Galaxy S III Android Development] Gray.Fox:
i've rooted my phone, installed siyah Kernel, busybox, and did read all replies just to get it working on my phone

alot of mods here in xda but not all of them are really useful like this mod

one of the best mods, keep up the good work

a124@android:/ # free

total	used free	shared buffers

Mem: 852824	782796 70028 0	135512

-/+ buffers:	647284 205540

Swap:	1041404	73144 968260

my problem was busybox

it was not installed in xbin

thanks alot for your great work
[Galaxy S III Android Development] Geo1997:
Okk. So it seems to be a problem with siyah 1.8.4 not with swap (it would be weird). I don't have it with stock kernel.

Envoyé depuis mon GT-I9300
[Galaxy S III Android Development] fatthumb:
Is this compatible with JB 4.2.1? I'm using Temasek kangs, I believe his kernel has not include swap suppport though...
[Galaxy S III Android Development] Hunt3r.j2:
This will likely create bad sectors on the microSD with extended use if the swap partition is heavily loaded.

Be careful guys, this is an acceptable way to get more RAM, but don't be surprised if your microSD starts showing signs of corruption early on, backup up religiously.
[Galaxy S III Android Development] Yank555:
Unfortunately we need swap support in the kernel.

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3b Aroma (Linux 3.0.56) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] Yank555:
This is no news, and is also indicated in the OP btw, it only requires reading ;)

Now that said, I've been using swap for almost 2 years, never had a problem, and about 1 year on the same sd card with swap pretty filled all the time.

But this is why I refuse to put swap in internal memory, the theoretical risk is enough, an sd card is easily replaced, whereas internal memory ... :(

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3b Aroma (Linux 3.0.56) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] mirskym:
S3 Insists on Reflashing SD Card

I'm using your kernel 2.8a and a 16 GB microSDHC card that I just bought. I used MiniTool Partition wizard to create a 512 MB partition as Linux swap, Primary and partitioned the rest as a logical drive.

When I install your zip, it works, finds the swap partition, and when I rebooted I could see by typing Free in my terminal that swapping was working. But also when I rebooted, Android complained that the External SD card was blank or filled with unsupported files. It wouldn't let me use the second partition. Trying to copy files over to it using my file explorer won't work. Android keeps complaining about the SD Card and asks if I want to Format it. If I say yes, it does format the entire card, adds a couple of directories of its own and I can now copy files to the card. But that seems to have obliterated the swap partition because now swapping doesn't work and your installation zip complains it can't find the swap partition.

Did I do something wrong when I prepared the SD Card on my PC?
[Galaxy S III Android Development] Yank555:
Yep, the mistake is highlighted in RED ;)

You need to keep the FAT32 partition primary and the first partition on the card, it won't work else...

JP.
[Galaxy S III Android Development] mirskym:
:good::good:Thanks JB! That fixed it! Card and swapping working fine now. Now let's see how much it helps!

Thanks again!
[Galaxy S III Android Development] kkttt:
I've been using this mod on omega rom, works great. I'm trying out Darkie rom now with the same card, but doesn't seem to be running. Terminal emulator says 0 under swap.

Any ideas what I need to do?

Thanks.
[Galaxy S III Android Development] Yank555:
Check these three things :

- does kernel have swap support

- das ROM or ramdisk/kernel have init.d support

- is busybox installed in /system/xbin

JP.
[Galaxy S III Android Development] kkttt:
Thanks for the fast reply!

I see the kernel in settings -> about device is Siyah 1.8.4, I assume the first 2 requirements are met.

I've also installed busybox under system/xbin as per your installation guide.

Still showing 0 swap :(
[Galaxy S III Android Development] Yank555:
Well at least the first req. is met, init.d support ?

Is there a /data/swap.0.log ? If so, please post it ;)

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3d Aroma (Linux 3.0.57) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] kkttt:
Nope, couldn't find any swap.0.log only found a hardswap.log
[Galaxy S III Android Development] Yank555:
Then you don't have init.d support.

Check 2 things :

1) do you have a /system/etc/init.d folder

--> If the folder is missing, create it, give proper rights and reflash the mod so the script can be installed.

2) If you do have the folder, is there a swap script inside

--> If there is no script, post /data/hardswap.log

--> If there is a script, you most definately don't have init.d support

JP.
[Galaxy S III Android Development] kkttt:
Aww.. U're right, there's no init.d folder :( Guess I'll have to try another rom.
[Galaxy S III Android Development] Yank555:
Nope, just create the folder and try, init.d support can be given by Siyah, but the folder must be created by someone (you in this case) ;)

JP.
[Galaxy S III Android Development] kkttt:
Got it! Thanks :)
[Galaxy S III Android Development] Deeper:
Swap didn't work

I installed your zip - follow you instruction - but my swap usage

u0_a120@android:/ $ free
total used free shared buffers
Mem: 852860 762980 89880 0 1956
-/+ buffers: 761024 91836
Swap: 0 0 0
u0_a120@android:/ $

zeroh.

This is my hardswap.log,

-----------------------------------------------
Hard Swap Flasher by Yank555.lu v1.1 for SGS3
-----------------------------------------------
SD-card device = /dev/block/mmcblk1

Paratition table for SD-card :
------------------------------

Disk /dev/block/mmcblk1: 31.3 GB, 31393316864 bytes
255 heads, 63 sectors/track, 3816 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk1p1 * 1 3690 29632512 c Win95 FAT32 (LBA)
/dev/block/mmcblk1p2 3690 3817 1024000 82 Linux swap

Swap partition = /dev/block/mmcblk1p2

- formating swap partition '/dev/block/mmcblk1p2'
Setting up swapspace version 1, size = 1048571904 bytes

- copying swap activation script to /system/etc/init.d

done.

please help, why didn't work?
[Galaxy S III Android Development] Yank555:
3 possible causes :

1) kernel lacks swap support

2) busybox isn't installed in /system/xbin

3) lack of init.d support (or /system/etc/init.d folder missing so no script can be installed)

JP.
[Galaxy S III Android Development] Deeper:
Thanks for quick answer. The 3rd point solved - missing init.d folder. Now working, I'm curious. :)
[Galaxy S III Android Development] ginodp:
init.d check

Yank can you check if my init.d folder is ok? I reinstalled my phone. So everything is fresh. Also got myself a transcend 32gb class 10.

Busybox: latest

Hard swap: latest by you

Kernel: latest by you

ROM: ParanoidAndroid latest

Partition: 256mb

Also I did a custom setup of the kernel and think that loudspeaker +2 is better then +3. The sound is a bit better. +3 was a bit to loud that the sound sounded slightly different then usually.

Verstuurd van mijn GT-I9300 met Tapatalk
[Galaxy S III Android Development] Yank555:
Looks fine to me. Just a hint, though, if yiu use my kernel, you can activate hardswap from kernel Aroma and there's no need to flash this mod then.

In this case you won't have the 991swap file as the kernel handles this differently ;)

JP.

PS: merry Xmas to all ;)

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3e Aroma (Linux 3.0.57) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] ginodp:
Ait thanks for the hint. The 991swap is gone. I saw it in Aroma because I use custom setup.

So I had double swap.

Do I still need the partition in order to have hardswap working for your kernel? And are the other files in my init.d dir created by your kernel?

Going to put siyah on my other S3 with this hardswap.

Thanks.

Verstuurd van mijn GT-I9300 met Tapatalk
[Galaxy S III Android Development] Yank555:
Yes, the partition is still needed.

The kernel will not put any file in init.d, so whatever is in there, it's not coming from the kernel.

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3f Aroma (Linux 3.0.57) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] NeoPhyTe.x360:
What do you think about the idea of a faster swap in cache partition?

I remembered some times ago of a desire data2ext, and I've applied this to us for a faster swap (seeing que idea of ownhere)

#!/sbin/busybox sh

if [ -e /cache/swapfile.swp ];
then
/sbin/busybox mount -t ext4 -o remount,rw,loop,commit=19,barrier=0,nobh,nouser_xattr,errors=continue,noatime,nodiratime,nodev /cache
swapon /cache/swapfile.swp
echo "100" > /proc/sys/vm/swappiness
fi

# If not exists add 640MB swap and disable journaling for more speed
if [ ! -f /cache/swapfile.swp ]
then
umount /cache
/sbin/mkfs.ext4 -b 4096 -m 0 -F -L cache /dev/block/mmcblk0p8
/sbin/e2fsck -yf /dev/block/mmcblk0p8
/sbin/tune2fs -o journal_data_writeback -O ^has_journal /dev/block/mmcblk0p8
/sbin/busybox mount -t ext4 -o rw,loop,commit=19,barrier=0,nobh,nouser_xattr,errors=continue,noatime,nodiratime,nodev /dev/block/mmcblk0p8 /cache
sleep 1
dd if=/dev/zero of=/cache/swapfile.swp bs=1024 count=655360
mkswap /cache/swapfile.swp
swapon /cache/swapfile.swp
echo "100" > /proc/sys/vm/swappiness
fi

What do you think? seems faster (I've done from initramfs in my kernel), but I haven't done full tests yet.

.
[Galaxy S III Android Development] Yank555:
Yes, it's faster, but I'm not keen to use internal memory for swap as wearing that out means you would brick the phone.

So in doubt, I'd rather wear out a slower but easily replaced sd card.

But mattiadj has done such a mod already...

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3f Aroma (Linux 3.0.57) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] NeoPhyTe.x360:
Yeah, I'm triying it for the moment from cache because I have a slow sd now, will try from sd too.

I haven't seen mattiadj mod, will look it, for the moment ext4 no journal, and loop's working fine (no lags for the moment)
[Galaxy S III Android Development] fitipardi:
Thanks mate fot the explanation

Regards

Enviado desde mi GT-I9300 usando Tapatalk 2
[Galaxy S III Android Development] mchosch:
Hi,

Can not flash the hard-swap-flasher file on 4.2.1

Is there a fix?

Gesendet von meinem GT-I9300 mit Tapatalk 2
[Galaxy S III Android Development] Yank555:
I suppose the updater script may need an update ... I've just started testing 4.2.1 ROMs ... using my kernel on CM10.1 / AOSP 2.4.1 ROMs had swap working fine, but I never tested flashing the swap mod alone.

What ROM are you on ?

JP.

PS: Btw, the mod will not work on a stock kernel by lack of swap support even if it flashes fine.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3f Aroma (Linux 3.0.57) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] mchosch:
I'm on rootbox nightly (AOKP)

i have flashed your 1.3f,

after flashing that, my swap is not initialzed. On AOKP 4.1.2 it worked perfect

Gesendet von meinem GT-I9300 mit Tapatalk 2
[Galaxy S III Android Development] Yank555:
OK :

- if you use my 1.3f kernel, swap support is given and init.d support as well (even if the kernel doesn't need it for it's own hardswap)

- if it worked on 4.1.2, your card is correctly partitioned

Then I'd say the only potential problem left is busybox not installed in /system/xbin... Can you check that ?

JP.

PS: Just in case, if you use hardswap through my kernel, no need to flash this mod on top of it, but I guess you know that already ;)
[Galaxy S III Android Development] mchosch:
busybox is installed in /system/xbin

the error is:

"file_getprop: failed to stat "/tmp/Yank555.lu/swap/install/hardswap.prop": no such file or directory

I thought its a file that is installed from kernelscript in aroma??
[Galaxy S III Android Development] Yank555:
At what point do you get this error message ? After you chose Aroma settings and while it is flashing the kernel ?

Which kernel version are you actually flashing (Sammy, AOSP 4.1.x or AOSP 4.2.x) ?

And which recovery are you using ?

JP.
[Galaxy S III Android Development] mchosch:
i have installed AOSP 4.2.x (1.3f),

I get the message at the end of installation (summery),

the kernel installes perfect,

after reeboot i go to console ands "free" gives back: swap 0 0 0

so we know there is something wrong, not only a message....

PS: openrecovery 2.3.3.0
[Galaxy S III Android Development] Yank555:
Maybe that is an issue with that recovery then ... ?! As I flashed the very same kernel yesterday evening on SuperNexus 2.0 and swap is working... I use TWRP 2.3.3.0.

Can you post the following file : /data/hardswap.log

JP.
[Galaxy S III Android Development] mchosch:
there is no such file :confused:
[Galaxy S III Android Development] Yank555:
And /data/kernel.log ?

JP.
[Galaxy S III Android Development] mchosch:
no such file :confused:

not in /data/

not in /sdcard/data/

ps: searching for kernel.log in root (/) and behind gives 0 results
[Galaxy S III Android Development] Yank555:
Then I suppose openrecovery only supports new 4.2.x mounting and TWRP accepts both :(

Maybe I need to update the "updater-script" to fit 4.2.x mounting for this to work on newer 4.2.x compliant recoveries...

Will have to look into that tonight.

JP.

PS: Will post my findings in the kernel thread, this is getting a bit too off topic for the hardswap thread ;)
[Galaxy S III Android Development] mchosch:
openrecovery == twrp

if you install over goomanager it names: install openrecoveryscript

this is twrp
[Galaxy S III Android Development] puffo81:
Installed your MOD right now, everything is working fine, even resizing SD card (not delete/recreate).

See how it works now, I have a Class4 SD that is not that much! Thank for your effort Yank!
[Galaxy S III Android Development] Yank555:
Strange, flashed fine on CM10.1 nightly and SuperNexus 2.0 ... will see tonight ;)

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3f Aroma (Linux 3.0.57) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] mchosch:
SuperNexus is also based on cm10.1

maybe AOKP is a bit different at that point?

could it help, if you take contakt with bajee11 (the developer of AOKP and AOKP/RootBox on SGS2 and SGS3) ?
[Galaxy S III Android Development] Yank555:
Can you point me to the ROM thread, so I'll have a look and would know who to contact if I have questions ;)

JP.

Sent from my custom Paranoid Android 2.54 / Yank555.lu CM10 kernel v1.3f Aroma (Linux 3.0.57) powered Galaxy S3 i9300 using Tapatalk 2
[Galaxy S III Android Development] mchosch:
Rootbox on XDA

the nightly is on #397
[Galaxy S III Android Development] Yank555:
OK, I found the problem, the installation script relies on the sh of the ROM, but TWRP won't start AOKP's shell ...

I'll change this and reupload the kernel. Can you keep track of the kernel post, so you can redownload and test ?

JP.