I have the complete source code of my Android device. How can I make my internal phone memory/SD card be used as a swap space in my Android phone to increase performance on low RAM?
-
I have complete source code for my Android phone. What I need is to allocate space from SDcard or Internal Phone memory to be used as swap space for Android. I know its there in Linux, but how can I port the same in my Android device. What could be the possible changes I had to make in my Android kernel, so that my phone starts using swap memory same as linux.
-
Answer:
XDA developers Solution. 1.- Root your device 2.- Make a swap partition in your sdcard (this step will format your sdcard!) http://forum.xda-developers.com/wiki/SD_card_partitioning 2.1-In step 3 select "swap partition" 2.2-I recommend to make ~512MB partition because the SO will be going to fill it during you use the phone, but i always had 1GB partition, and no problems You can select 100MB or 50MB, but this is too little 3.- Check if there is a folder called init.d inside /system/etc/ 3.1-If its there, follow next steps 3.2-If it is not there, you must activate init.d support, follow this tutorial: http://forum.xda-developers.com/showthread.php?t=1422061 3.- Copy 00userinit file to your device (must remove the .txt extension of the file, because i needed to put it to attatch the file) 4.- With root explorer, xplore, or similar copy it to /system/etc/init.d 5.- Set all permissions: rwxr-xr-x 6.- Reboot device 7.- For checking if it works, download Terminal emulator and type "free". See attatchment. 8.- If "swap" line has no "0" value, it works, congratulations With this, you will: Have swapping activated in your phone permanently, or until you remove that script or change of ROM. Have bigger RAM memory amount, depending on your swap partition size If you use supercharger or any RAM manager program, i should recomend you to activate hard gaming option, because: -As you have bigger RAM memory, the useless aplications, instead of be closed, they will be stored in your sdcard partition so, you re able to have multitasking and hard gaming option at the same time But this is not all!! You can open and edit this file to adapt it to your requirements: You can edit this line to set swapiness cuantity, this defines the OS tendency to use swap partition, I not recommend to set it to 100, but 60 is good. Also, if you have slower sdcard, you should set it to 30~40: -Change 60 value by something you want from 1 to 100 "then echo 60 > /proc/sys/vm/swappiness;" If you have another sdcard partition like EXT4 or something to APP2SD, you should change the last number of "mmcblk0p2" by the number of the partition, i mean: -If you have 3 partitions with this order: Fat32(that you use everyday), EXT4, and SWAP you should change it by mmcblk0p3 -If 3 partitions with this order: Fat32, SWAP,and EXT4, you should set it mmcblk0p2 I forgot it! To use this, remember that you should: Quote: INSTALL THE LATEST BUSYBOX VERSION!!!
Sumit Ranjan Panda at Quora Visit the source
Other answers
mkswap /dev/block/sdpartion: device node of the sd partition. swapon /dev/block/sdpartion confirm it with cat /proc/swaps. This should output swap partion. There are two more techniques, zRam and zswap: This requires thier driver to be enabled in Kernel. zRAM is interesting. it doesn't require your sd partition. It creates swap partion in the RAM. LRU pages are compressed and stored here. Suppose, if you have 1GB LRU pages after compress it will be 300MB. where those pages are required it will compress and give to the system. As you are looking for swap partition in SD. Use zSwap. It will have swap partition in RAM and also in disk. Few pages are compressed and stored in ram and few are stored in sd partition.
Akshay Ithal
Related Q & A:
- How to I save WII games on a SD card?Best solution by Yahoo! Answers
- How can I plug a regular phone into my cell phone?Best solution by Yahoo! Answers
- How can I make a phone call to a cruise ship?Best solution by traveltips.usatoday.com
- Can I make a reservation with no credit card?Best solution by Yahoo! Answers
- How do I save the files on my SD card to the internal memory of my phone?Best solution by forums.androidcentral.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.