Related
If any of you are using SD Swap, DataSwap or zRam and you notice your swap usage in up higher than you expected (say for example on my system 60MB or so used with 64MB Dataswap + 10% zRam)
Here's a little shell script you can copy to /data/local/tmp, chmod 0775 on it, and then run it from adb shell via this command:
Code:
sh ./chkswap.sh | grep "Swap used" | grep -v "Swap used: 0" |sort -n -k 3
(my grep/sort knowledge is a tad limited so it could be done better).
You'll get an output similar to this, with the processes sorted from least amount of swap used to most:
Code:
Swap used: 8 - ( 1329 root 4532 S /sbin/adbd )
Swap used: 12 - ( 1328 root 5384 S /system/bin/rmt_storage /dev/block/mmcblk0p13 /dev/block/mmcblk0p14
Swap used: 20 - ( 1 root 364 S /init
Swap used: 48 - ( 1271 root 844 S /system/xbin/virtuous_oc )
Swap used: 56 - ( 1325 root 884 S /system/bin/installd )
Swap used: 60 - ( 1315 system 848 S /system/bin/servicemanager )
Swap used: 64 - ( 754 root 300 S /sbin/ueventd )
Swap used: 68 - ( 1327 compass 1184 S /system/bin/akmd )
Swap used: 68 - (18726 root 712 S /system/bin/debuggerd )
Swap used: 76 - ( 1330 root 1152 S /system/bin/htc_ebdlogd -s -k -P 7 )
Swap used: 80 - ( 3537 bluetoot 844 S /system/bin/brcm_patchram_plus --enable_hci --enable_lpm --baudrate 3000000 --patchram /vendor/firmware/b )
Swap used: 136 - ( 1324 bluetoot 1376 S /system/bin/dbus-daemon --system --nofork
Swap used: 148 - ( 1319 radio 16416 S /system/bin/rild )
Swap used: 172 - ( 1326 keystore 1788 S /system/bin/keystore /data/misc/keystore )
Swap used: 192 - ( 1316 root 4044 S /system/bin/vold )
Swap used: 200 - (31037 wifi 2476 S /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -iwlan0 -c/data/misc/wifi )
Swap used: 260 - ( 1317 root 7724 S /system/bin/netd )
Swap used: 280 - ( 3716 bluetoot 2188 S /system/bin/bluetoothd -n )
Swap used: 288 - ( 1358 root 992 S /system/bin/logcat2 -v time -f /devlog/system_log -r 1024 -n 50 *:w )
Swap used: 884 - ( 1322 drm 14048 S /system/bin/drmserver )
Swap used: 1064 - ( 1323 media 40916 S /system/bin/mediaserver )
Swap used: 2124 - ( 1320 system 73516 S /system/bin/surfaceflinger )
Swap used: 6740 - (19429 system 318m S {ndroid.settings} com.android.settings )
Swap used: 6856 - (19042 app_133 286m S {facebook.katana} com.facebook.katana )
Swap used: 6932 - (18993 app_135 273m S {o.mobiledefense} com.neevo.mobiledefense )
Swap used: 7348 - (18863 app_1 280m S {d.process.acore} android.process.acore )
Swap used: 7380 - (23142 app_14 270m S {d.process.media} android.process.media )
Swap used: 7392 - (23111 app_134 275m S {ogle.android.gm} com.google.android.gm )
Swap used: 7396 - (23293 app_102 269m S {es.fancywidgets} com.anddoes.fancywidgets )
Swap used: 7412 - (18822 app_97 283m S {pps.googlevoice} com.google.android.apps.googlevoice )
Swap used: 7420 - (23250 app_130 278m S {onFriendService} com.google.android.apps.maps:LocationFriendService )
Swap used: 7444 - (23092 app_130 293m S {droid.apps.maps} com.google.android.apps.maps )
Swap used: 7444 - (23205 app_130 283m S {LocationService} com.google.android.apps.maps:NetworkLocationService )
Swap used: 7564 - (13961 app_118 277m S ccc71.bmw.pro )
Swap used: 7660 - (19492 app_11 267m S {id.defcontainer} com.android.defcontainer )
Swap used: 7688 - (23237 app_130 275m S {s:FriendService} com.google.android.apps.maps:FriendService )
Swap used: 7792 - (16806 app_10 267m S {roid.dspmanager} com.bel.android.dspmanager )
Swap used: 8060 - ( 1534 app_45 316m S {e.process.gapps} com.google.process.gapps )
Swap used: 8096 - ( 3783 app_44 306m S {.android.kineto} com.android.kineto )
Swap used: 8448 - ( 1321 root 258m S zygote /bin/app_process -Xzygote /system/bin --zygote --start-system-server )
Swap used: 8620 - ( 3861 app_41 267m S {android.smspush} com.android.smspush )
Swap used: 11064 - (26947 app_42 305m S {nddoes.launcher} com.anddoes.launcher )
Swap used: 12268 - ( 3624 system 356m S {ndroid.systemui} com.android.systemui )
Swap used: 12436 - ( 1785 system 508m S system_server )
Swap used: 19772 - ( 3762 app_66 305m S {chtype.swiftkey} com.touchtype.swiftkey )
Swap used: 20464 - ( 3778 radio 312m S {m.android.phone} com.android.phone )
From above you can see that the phone and SwiftKeys3 uses most of my swap.
My free output at the tim of running the list above looked like:
Code:
total used free shared buffers
Mem: 375916 309656 66260 0 260
-/+ buffers: 309396 66520
Swap: 103120 61532 41588
So there you have it, a scripted way to find out what's eating most of your swap. (script attached).
kbeezie, you seem to be on a twofold mission to be the most helpful person on our forum and to re-establish our faith in this community. Well, the little things like this help a lot.
I remember the days when everyone shared everything they learned about android. Then many lost their way, and open source seemed to become everyone's pet secret.
I understand getting huge chunks of hard work ripped off is crappy; when you've worked so hard on something and someone just yoinks it for themselves.
But when someone who isn't learned in code drops by and sees this, it makes them just a little more excited about typing stuff into terminal emulator. And I bet that's how a lot of great devs are born.
Cheers.
Sent from my HTC Desire Z using xda app-developers app
Kbee u know how to set how much % of zram to use? Thank in advance
Sent from my HTC Desire Z using xda app-developers app
Steven How said:
Kbee u know how to set how much % of zram to use? Thank in advance
Sent from my HTC Desire Z using xda app-developers app
Click to expand...
Click to collapse
In Mimicry 1.3.2 RC1 (soon to be released as 1.3.2) the zRam setting has been fixed (ie: setting it in 1.3.1 does nothing), so that you can pick 10%, 18%, 26% under performance setting (ie: that % of total ram).
kbeezie said:
In Mimicry 1.3.2 RC1 (soon to be released as 1.3.2) the zRam setting has been fixed (ie: setting it in 1.3.1 does nothing), so that you can pick 10%, 18%, 26% under performance setting (ie: that % of total ram).
Click to expand...
Click to collapse
I'm not using that Rom anyway..using ice sensewich atm..
Sent from my HTC Desire Z using xda app-developers app
Steven How said:
I'm not using that Rom anyway..using ice sensewich atm..
Sent from my HTC Desire Z using xda app-developers app
Click to expand...
Click to collapse
Ahh ok, well the kernel would have to have zRam (formerly compcache) support enabled and a script to set it up. I don't know if the DataSwap mod in my signature would work for a sense rom or not (it might, it's very simple).
kbeezie said:
Ahh ok, well the kernel would have to have zRam (formerly compcache) support enabled and a script to set it up. I don't know if the DataSwap mod in my signature would work for a sense rom or not (it might, it's very simple).
Click to expand...
Click to collapse
Wat I know is swappiness is using sd card,and zram is compress the file to disk and wat is dataswap?
Sent from my HTC Desire Z using xda app-developers app
Steven How said:
Wat I know is swappiness is using sd card,and zram is compress the file to disk and wat is dataswap?
Sent from my HTC Desire Z using xda app-developers app
Click to expand...
Click to collapse
Simply put a swap file on your /data partition (ie: faster and more fluid than SD-Swap, and after a reboot is recreated on a different part of the chip so it's not working one part of the chip all the time like SD-Swap does).
Click the linky in signature it goes into a tad more details. It's generally recommended to use it with Sd-ext since that way you split the I/O between two devices.
kbeezie said:
Simply put a swap file on your /data partition (ie: faster and more fluid than SD-Swap, and after a reboot is recreated on a different part of the chip so it's not working one part of the chip all the time like SD-Swap does).
Click the linky in signature it goes into a tad more details. It's generally recommended to use it with Sd-ext since that way you split the I/O between two devices.
Click to expand...
Click to collapse
So wat I do is just flash that zip in attachment?isn't that for elitemod only??
Sent from my HTC Desire Z using xda app-developers app
So now wat should I do? Can I just extract the file of 80dataswap to init.d? And the sdext? And set permission to rwx rwx rwx? How much data swap is ok? 128 or 64 mb? If I enable data swap,will my data partition decrease ?
I'm still kinda confuse with dataswap and sd ext after reading up..still don't really understand..hope someone can simplify for me to understand thank in advance
Sent from my HTC Desire Z using xda app-developers app
No you just flash it, it uses the aroma installer to let you pick and choose options and no its not just for elitemod just the original code came from elitemod.
And yes dataswap uses /data space (which is negligible if you have an enabled sdext partition on your sd card since data/app and /app-private get stored there instead.)
The big question is whether or not you do enough on your phone to actually need the benefits of swap. It usually helps multitasking or performance of memory greedy apps
Sent from my T-Mobile G2
kbeezie said:
No you just flash it, it uses the aroma installer to let you pick and choose options and no its not just for elitemod just the original code came from elitemod.
And yes dataswap uses /data space (which is negligible if you have an enabled sdext partition on your sd card since data/app and /app-private get stored there instead.)
The big question is whether or not you do enough on your phone to actually need the benefits of swap. It usually helps multitasking or performance of memory greedy apps
Sent from my T-Mobile G2
Click to expand...
Click to collapse
After I enable the data swap..its pretty fluid....I already have a sd ext 122mb after I activate I left only 24 mb free and all the apps vanish..left only like 64kb in that app..unable to open..any idea?
How do I check if my data swap is working? And setting for it?
Sent from my HTC Desire Z using xda app-developers app
Steven How said:
After I enable the data swap..its pretty fluid....I already have a sd ext 122mb after I activate I left only 24 mb free and all the apps vanish..left only like 64kb in that app..unable to open..any idea?
How do I check if my data swap is working? And setting for it?
Sent from my HTC Desire Z using xda app-developers app
Click to expand...
Click to collapse
128MB SD-EXT is extremely small (and I've no clue why anyone would make one that small, maybe an extremely old school method of apps2SD suggestion), the SD-EXT partition must be at LEAST as big as your /data , so 2GB Sd-ext is recommended as a good fit. So if you wish to use the sd-ext feature you need to re-partition your SD card with a bigger SD-EXT partition.
Dataswap would show under typing free in the terminal (or adb shell) on the swap line.
kbeezie said:
128MB SD-EXT is extremely small (and I've no clue why anyone would make one that small, maybe an extremely old school method of apps2SD suggestion), the SD-EXT partition must be at LEAST as big as your /data , so 2GB Sd-ext is recommended as a good fit. So if you wish to use the sd-ext feature you need to re-partition your SD card with a bigger SD-EXT partition.
Dataswap would show under typing free in the terminal (or adb shell) on the swap line.
Click to expand...
Click to collapse
Idk how I get 128mb of sd ext and how do I check the data swap with terminal?? The command free??
Mind post me a link to make to make bigger partition of sd ext? Thank you in advance
Sent from my HTC Desire Z using xda app-developers app
in terminal type
free
if you have 4ext recovery you can check it there as well as change your sdext partition. you should also be able to partition your sdcard via clockwork
Sent from my HTC Vision using xda premium
demkantor said:
in terminal type
free
if you have 4ext recovery you can check it there as well as change your sdext partition. you should also be able to partition your sdcard via clockwork
Sent from my HTC Vision using xda premium
Click to expand...
Click to collapse
Using cwm to make sd ext? All my data will be erase right? Have to wait till next 2 week since I have exam..
Sent from my HTC Desire Z using xda app-developers app
you can backit up first and then restore it. if you change to 4ext recovery it can partition without a wipe, one of the many reasons I recomend it over clockwork
Sent from my HTC Vision using xda premium
Steven How said:
Using cwm to make sd ext? All my data will be erase right? Have to wait till next 2 week since I have exam..
Sent from my HTC Desire Z using xda app-developers app
Click to expand...
Click to collapse
Using either ClockWorkMod or 4EXT Touch Recovery ( I prefer 4EXT ), make a Nandroid backup of your currently installed rom.
Then Toggle USB Storage and copy ALL the content off of your SD Card onto your computer.
Using either CWM or 4EXT Repartition the SD card (all data will be lost on the card):
At least a 2GB SD-EXT (1GB is the limit, do not make one smaller than 1GB) partition.
Skip the option for SD Swap (ie: don't bother with a swap partition on the SD Card if you're going to use DataSwap)
And in 4EXT if you're asked for a size for a second SD-EXT partition, skip it, only the first Sd-ext partition will be supported.
If asked for a filesystem type, choose ext4.
THEN Toggle USB Storage again and copy back all your SD card data (which will be going onto the FAT32 portion of the SD card).
You'll then have the SD card with data again, but this time with a 2GB SD-EXT partition on it.
If you have a Rom backup Prior to the SD-EXT enabling (which was advised to have to begin with), you can restore that so that you get your apps back, and then re-enable SD-EXT now that the partition has enough storage to hold all the apps.
demkantor said:
you can backit up first and then restore it. if you change to 4ext recovery it can partition without a wipe, one of the many reasons I recomend it over clockwork
Sent from my HTC Vision using xda premium
Click to expand...
Click to collapse
U mean I can reset my sd ext without formatting the sd card with 4xt recovery? And after I install app over to sd ext partition..the app can't be found anywhere,any idea?
Sent from my HTC Desire Z using xda app-developers app
yes but it is a good idea to make a back up first just in case
as for the apps hidden this may be due to the rom you are using, some don't have sdext enabled out of the box
Sent from my HTC Vision using xda premium
Is it possible to expand the ram memory when we use the internal storage? I dont use it and i dont need that .. its a good idea or not ? If its possible
Sent from my HTC One V using xda premium
No answer? Not possible or..?
Sent from my HTC One V using xda premium
you mean using external storage as a booster just like ReadyBoost on windows, right?
I think he's reffering to using the eMMC 100MB internal storage as a swap partition
Nice concept it will be great if were use internal memory as ram so we can get more ram....if its possible so....
Sent from my One V using xda premium
rockstar_26 said:
I think he's reffering to using the eMMC 100MB internal storage as a swap partition
Click to expand...
Click to collapse
Personally I don't think that that would be a good idea. emmc has limited write cycles, and swap does use the cycles quite hard, so the emmc will be dead in no time, or at least it will shorten the lifespan of the phone quite much.
And for the concept. Swap uses different partition type, so even if possible, it will require the reformat of the partition, which means s-off practically. If you need and want swap, a partition on a class6 or higher SD will be more better in my opinion at least. That could be said switched if the partition dies. Also this is implemented in devices (like SE X8 and X10s).
Sent from my ONE V with CM10
So its not possible ? The phone has small ram its laggy sometimes :/
Its enough if 50 mb of the internal storage (emmc) used as ram "booster" mybe full sense will be more smoother and possibler xd
My english is not so good sry
Sent from my HTC One V using xda premium
dontbelive said:
So its not possible ? The phone has small ram its laggy sometimes :/
Its enough if 50 mb of the internal storage (emmc) used as ram "booster" mybe full sense will be more smoother and possibler xd
My english is not so good sry
It is possible one way or another, but I won't use it that's for sure. The V-s RAM is fragile even in stock, so I don't want to play with it.
And lag will be lag, there is no RAM that can match the speed of the internal RAM, even if it is a built in emmc. 512mb is not much I agree, but that is a limit that devs cannot really overcome. I personally vote for sd-swap if I must choose.
Click to expand...
Click to collapse
Can you explain short what sd-swap.is?
Sent from my HTC One V using xda premium
dontbelive said:
Can you explain short what sd-swap.is?
Sent from my HTC One V using xda premium
Click to expand...
Click to collapse
A SWAP partition is the SD card, which is enabled from kernel, and used as such after boot.
ah okeey
I have downloaded an app from.the market names.swapper i will test it for 2 days how the performance is
Sent from my HTC One V using xda premium
The app helped a bit i can play games without lag and i have flashed the full sense patch and runs soother than before
I recommend this app
Sent from my HTC One V using xda premium
dontbelive said:
The app helped a bit i can play games without lag and i have flashed the full sense patch and runs soother than before
I recommend this app
Sent from my HTC One V using xda premium
Click to expand...
Click to collapse
Well, this is the other way I mentioned, a "file" which is swap partition and mounted as such. Don't know about however, that the kernel even supports swap, but I don't really know about the work profile of the programme.
Good it helped you eventough
Hi
For more information see also here
http://forum.xda-developers.com/showthread.php?t=1805843
There is a good description of whats possible
max
maxwen said:
Hi
For more information see also here
http://forum.xda-developers.com/showthread.php?t=1805843
There is a good description of whats possible
max
Click to expand...
Click to collapse
The script enabled swap needs the kernel for swap support on SD, or am I wrong?
Sent from my ONE V with CM10
Hi
Actually we have everyting to use swap
This can be done even using an init.d script
I am currently "playing" with it and keep you informed
max
Hi
Ok guys
Here is a script that will enable the swap partition of 130m
on the internal emmc. This will make only sense if you ROM
hasnt already enabled swap!
To check use cmdline and enter
Code:
cat /prov/swaps
If you see there already a line with
Code:
/dev/block/mmcblk0p27
Then you dont need it!
USE IT AT YOUR OWN RISK!!!
http://www.mediafire.com/?i9xc4hnfheztgir
If you enter any command from inside that script on cmdline
make sure you ARE NOT MIXING up the partition!
It MUST ALWAYS BE /dev/block/mmcblk0p27!!!
If you use the wrong partition data loss is possible!!!
So make a backup before trying it.
You MUST have busybox installed for this to work!
And busybox MUST be installed in /system/xbin/
else you need to adapt the script
I have tested it on CM9 but it will work also on sense ROMs
If you use a kernel with init.d script support like KISS you can put
this script into /etc/init.d and it will be executed on boot
Dont forget to make it executable (chmod 755) also
You can also run this script using ScriptManager
The basic two commands used are
Code:
busybox mkswap /dev/block/mmcblk0p27
busybox swapon /dev/block/mmcblk0p27
First one will create a swap "area" on that partition
If you use the wrong partition here say goodbye to the
data there
Second line is enabling this swap area for the kernel
To see if it worked run
Code:
busybox free
You should see something like this
Code:
total used free shared buffers
Mem: 368696 336132 32564 0 18452
-/+ buffers: 317680 51016
Swap: 131064 3784 127280
If you want to turn of swap without rebooting you can
issue the following command
Code:
busybox swapoff /dev/block/mmcblk0p27
BTW: you will NOT see swap space in "Available RAM" in Android!
Max
but it still works as a RAM right?
Wait.. i don't really understand that...
maxwen said:
Hi
Ok guys
Here is a script that will enable the swap partition of 130m
on the internal emmc
USE IT AT YOUR OWN RISK!!!
http://www.mediafire.com/?i9xc4hnfheztgir
If you enter any command from inside that script on cmdline
make sure you ARE NOT MIXING up the partition!
It MUST ALWAYS BE /dev/block/mmcblk0p27!!!
If you use the wrong partition data loss is possible!!!
So make a backup before trying it.
You MUST have busybox installed for this to work!
And busybox MUST be installed in /system/xbin/
else you need to adapt the script
I have tested it on CM9 but it will work also on sense ROMs
If you use a kernel with init.d script support like KISS you can put
this script into /etc/init.d and it will be executed on boot
Dont forget to make it executable (chmod 755) also
You can also run this script using ScriptManager
The basic two commands used are
Code:
busybox mkswap /dev/block/mmcblk0p27
busybox swapon /dev/block/mmcblk0p27
First one will create a swap "area" on that partition
If you use the wrong partition here say goodbye to the
data there
Second line is enabling this swap area for the kernel
To see if it worked run
Code:
busybox free
You should see something like this
Code:
total used free shared buffers
Mem: 368696 336132 32564 0 18452
-/+ buffers: 317680 51016
Swap: 131064 3784 127280
If you want to turn of swap without rebooting you can
issue the following command
Code:
busybox swapoff /dev/block/mmcblk0p27
BTW: you will NOT see swap space in "Available RAM" in Android!
Max
Click to expand...
Click to collapse
This is just perfect maxwen! I have created 2 widgets that let me create a swap partition on the fly! whenever I use a memory intensive app (Games for example) I turn on swap. For everyday use I just turn it off!!:highfive:
rockstar_26 said:
This is just perfect maxwen! I have created 2 widgets that let me create a swap partition on the fly! when ever I use a memory intensive app (Games for example) I turn on swap. For everyday use I just turn it off!!:highfive:
Click to expand...
Click to collapse
This seems interresting enough. Max, if the kernel already supports it, swapon will work wit an sd-swap partition, am I right? Or to be more precise, I just have to mount the swap partition of the sd (p2 if I'm right, but can see into that), then swapon?
No further action needed max, it works, will post a guide/walktrough wiwth init.d script soon.
Hi, everybody! dows anyone know if the file swap or the partition swap for ram will work on kitkat? and if yes, is there a tutoriali that i can read? thank you all
jam90 said:
Hi, everybody! dows anyone know if the file swap or the partition swap for ram will work on kitkat? and if yes, is there a tutoriali that i can read? thank you all
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=2095573
hack4er said:
http://forum.xda-developers.com/showthread.php?t=2095573
Click to expand...
Click to collapse
Thanks, i already knows what that apps do...do you know if there's a manually mode for the file.swap or if there's a tutorial for the swap partition? And do they works on kitkat?
Sent from my GT-I8150 using xda app-developers app
You can create a swapfile from terminal emulator. I suggest you to use internal memory, but if you have swapped your memory so it would be external memory.
First, Go to term. Then type
Su
targ=/external_sd/.swapfile
dd if=/dev/zero of=$targ bs=$((1024*1024)) count=512
mkswap $targ
swapon $targ
For "count=512" you can change the number to other swap size that you want.
You must to enable the swap ram on every boot from term again. Its simple, just type;
Su
Swapon /external_sd/.swapfile
Nb: you can change "external_sd" with "sdcard". Its up to you, but choose a disk that have more space to swap.
Sent from my GT-I8150 using xda premium
eryzerz said:
You can create a swapfile from terminal emulator. I suggest you to use internal memory, but if you have swapped your memory so it would be external memory.
First, Go to term. Then type
Su
targ=/external_sd/.swapfile
dd if=/dev/zero of=$targ bs=$((1024*1024)) count=512
mkswap $targ
swapon $targ
For "count=512" you can change the number to other swap size that you want.
You must to enable the swap ram on every boot from term again. Its simple, just type;
Su
Swapon /external_sd/.swapfile
Nb: you can change "external_sd" with "sdcard". Its up to you, but choose a disk that have more space to swap.
Sent from my GT-I8150 using xda premium
Click to expand...
Click to collapse
This works on cm10? just for curiosity
It work on all android version.
Sent from my GT-I8150 using xda premium
what advantage of this swap campare to turbo boost..because turbo boost will make pgone laggy after 2,3 days if phone not reboot
Sent from my GT-I8150 using Tapatalk 4
kacanghantu said:
what advantage of this swap campare to turbo boost..because turbo boost will make pgone laggy after 2,3 days if phone not reboot
Sent from my GT-I8150 using Tapatalk 4
Click to expand...
Click to collapse
There's no specific different, turbo boost using space for swap in /cache,/data and /system, normal swapram using /sdcard or /external_sd. Just that.
For performance, try it by yourself. Test by playing a game, not antutu.
If you're using normal swapram u can change the swappinnes value easily with performance control app. 0-50 for a good perform, 51-100 for heavy use(hard gaming,etc).
Sent from my GT-I8150 using xda premium
eryzerz said:
There's no specific different, turbo boost using space for swap in /cache,/data and /system, normal swapram using /sdcard or /external_sd. Just that.
For performance, try it by yourself. Test by playing a game, not antutu.
If you're using normal swapram u can change the swappinnes value easily with performance control app. 0-50 for a good perform, 51-100 for heavy use(hard gaming,etc).
Sent from my GT-I8150 using xda premium
Click to expand...
Click to collapse
so that mean the only difference is where the swap file created..thanks brother
Sent from my GT-I8150 using Tapatalk 4
kacanghantu said:
so that mean the only difference is where the swap file created..thanks brother
Sent from my GT-I8150 using Tapatalk 4
Click to expand...
Click to collapse
Yes, you got it. My pleasure brother
Sent from my GT-I8150 using xda premium
it always tell me that swapon failed !!!!
eryzerz said:
You can create a swapfile from terminal emulator. I suggest you to use internal memory, but if you have swapped your memory so it would be external memory.
First, Go to term. Then type
Su
targ=/external_sd/.swapfile
dd if=/dev/zero of=$targ bs=$((1024*1024)) count=512
mkswap $targ
swapon $targ
For "count=512" you can change the number to other swap size that you want.
You must to enable the swap ram on every boot from term again. Its simple, just type;
Su
Swapon /external_sd/.swapfile
Nb: you can change "external_sd" with "sdcard". Its up to you, but choose a disk that have more space to swap.
Sent from my GT-I8150 using xda premium
Click to expand...
Click to collapse
Uhh well i got 1.6gb on my device and i type count=500 but it could use all my phone space is the number wrong or what?
it says invalid argument
terminal emu. swaped on sd card but say invalid argument when swapon...pls help
Hi!
Since my phone's memory amount doesn't seem to be enough even for browsing, I've decided to create a swap partition. But I need your assistance since I got many questions.
- Do I have to format the whole SD card and then split it to two partitions? Isn't that possible to just change the size of the existing partition and make a new one from free space acquired because of that?
- Is my SD card good for that? It's AData 32GB MicroSDHC Class 10.
- What's the risk of potential data loss because of swap being enabled?
- Will that break the apps that are moved to SD card?
and last:
- Which method will work with the newest build of CM 10.1 by NeverGone/RU?
Will really appreciate any assistance!
Wysłane z mojego HTC Vision przy użyciu Tapatalka
While I don't think swap is needed (I have run both ways), when I did use swap (ICS,JB,KITKAT) I put the swap on the /cache mount point. I figured that putting swap on the sdcard might be slower and wear out the sdcard faster. Plus it appears that on 4.0+ Android the /cache file system is not used as much anymore.
So having said this, I would copy the file below to the /system/etc/init.d directory (making sure the permissions are correct).
-brad
===filename: 90cachswap
#!/system/bin/sh
# Enables swap on data partition
#
#
# file is /cache/swap
# POI: this can be used along with sdcard swap partition
# the load will be automatically evenly divided between the two locations
mv /cache/swap /cache/swap.old
busybox dd if=/dev/zero of=/cache/swap bs=1M count=128
chmod 0600 /cache/swap
mkswap /cache/swap
busybox swapon /cache/swap
rm /cache/swap.old
as title
st0123123 said:
as title
Click to expand...
Click to collapse
path;
/proc/sys/vm/swappiness
All kernels support swap, you just don't have a swap partition by default....
You can use a swap file. Simple create a non-sparse file of size x (dd if=/dev/zero of=/location/of/swap bs=4096 count=65536 # will create a 256MB swap file). You can then mount it as "mount -t swap -o loop /location/of/swap swap".
Note that it is not recommended as the writes may kill your flash storage. You may, alternatly, look for a kernel that has zRAM support. This is basically a compressed swap space in memory. But this will reduce your available RAM.
Give that the GNex has 1GB of RAM I would not recommend using swap space.