Is swap only usefull for gaming or it is also used when there a lot of apps running..
If the ram is totally used by the other apps and i open an app then will it run using swap or android system will kill the other app in background with least priority and make it run in the phone 's ram only...
In short is swap also usefull for multitasking...
IAmNice said:
Yes swap is useful for multitasking. It allows you to run 3-4 apps in the background. Consider swap if you have a fast sd card. If you open an app it will run in swap partion if your ram is full
Sent from my E15i using xda app-developers app
Click to expand...
Click to collapse
Man that's totally wrong! You obviously know nothing about how swap space works lol..
Swap partitions or files can be used like a ram buffer.. When ram gets full, the system can offload some data to the swap space, thus freeing some ram.
Apps NEVER EVER EVER run in swap space..
Using swap will drastically reduce the life of your sdcard. It is not advisable to use at all.
Uggh.. now I'm confused..
I just want to know that if the phones ram is full due to some apps running and i open a new app then wether it will run on swap or android system as it is architectured will kill the lowest priority app to free up space to run the new app launched in phone's ram..
Swap decrease sd cards life
bandarigoda123 said:
Swap decrease sd cards life
Click to expand...
Click to collapse
maybe you're right, but swap helped me a lot
Related
hi guys,Does Quasar kernel support swap?and how to enable it?
i tried to enable it but failed
and i'm thinking about there's a lot of free space that i never used in /data and /system,so why don't we use those useless space to swap for more ram?
or we can use ZRAM?and how to use it?
we have 512 mb memory, for what you want swap?
actually the ram we can use only have less than 300mb
hmm partitionning SDC should do the job, isn't it ? do "ext" partitions have something to do with that ?
I think there's no reason to use swap, but dxdiag32's idea is not bad... internal memory is quicker than sd...
Regards.
Nah, it doesn't support it.
I did some tests with ZRAM and ZCache back in the LG P500 days and it didn't seem to help with anything so I usually disable Swap support now.
Anyway, you can always mount a tmpfs partition to some applications to boost their I/O operations if that's what you're looking for.
Huexxx said:
I think there's no reason to use swap, but dxdiag32's idea is not bad... internal memory is quicker than sd...
Click to expand...
Click to collapse
Depends on the microSD card's class. A class 10 is faster than internal memory.
In fact, it's a shame they dropped the yaffs2 filesystem as in non-sequential I/O operations it's the best one.
Class10 is faster? At least internal memory will be less energy hungry... won't be?
Huexxx said:
Class10 is faster? At least internal memory will be less energy hungry... won't be?
Click to expand...
Click to collapse
Yes, class 10 (>= 10 mb/s write speed) is faster than internal memory.
This is why moving app, data and dalvik to microSD when you have such microSD provides a good boost on I/O operations. There's many folks using the combo CM + S2E + MicroSD Class 10.
As for battery, it's a good question but I bet it should be the same. I/O stuff isn't heavy.
most of us now is using C4 sdcard,at least in China is .so i wanna give us some more performance.my free space in /data partition keep more than 800MB for a long time,and i think more ram can provide us more stable phone.
Beware that RAM works differently for Android devices.
Whereas free RAM in Windows is arguably better than occupied RAM, this is not so for Android. In Android, having RAM allocated is good which is also behind the reason of why we shouldn't use task killers. That being said, we don't really need more than 512 MB of RAM for a heapsize of 32 MB and proper OOM groupings and adj values! Even with an aggressive usage, it's unlikely you'll manage to trigger an OOM (out of memory) throughout your day.
Here's an oldie but goldie article regarding this:
http://lifehacker.com/5650894/andro...ed-what-they-do-and-why-you-shouldnt-use-them
ok got it , thanks knzo
knzo said:
we shouldn't use task killers.
Click to expand...
Click to collapse
I understand the theory but because of my own experience I do not agree in 100% with You. My previous smartphone was Samsung Spica ( not much RAM ). I used to use my favourite IGO for navigation. It was impossible to succesfully launch IGO if I have not used task killer before.
Without task killer IGO just started and vanished within seconds.
pabgar said:
I understand the theory but because of my own experience I do not agree in 100% with You. My previous smartphone was Samsung Spica ( not much RAM ). I used to use my favourite IGO for navigation. It was impossible to succesfully launch IGO if I have not used task killer before.
Without task killer IGO just started and vanished within seconds.
Click to expand...
Click to collapse
That's because IGO triggered an OOM event and the ROM you had instead of doing an intelligent swipe and killing applications based on certain heuristics, was killing the process responsible for the OOM instead (IGO). It's a flag in sysctl called: OOM kill allocating task.
So in that case, it was just a lousy ROM/kernel. Or perhaps in Spica (old kernel, old android version) there wasn't this setting and the phone always killed the application that made the phone run out of memory. This explains why it vanished after a bit.
Either way I stand correct, there's no need for task killers in a device with >= 256 MB of RAM or properly configured.
knzo said:
That's because IGO triggered an OOM event and the ROM you had instead of doing an intelligent swipe and killing applications based on certain heuristics, was killing the process responsible for the OOM instead (IGO). It's a flag in sysctl called: OOM kill allocating task.
So in that case, it was just a lousy ROM/kernel. Or perhaps in Spica (old kernel, old android version) there wasn't this setting and the phone always killed the application that made the phone run out of memory. This explains why it vanished after a bit.
Either way I stand correct, there's no need for task killers in a device with >= 256 MB of RAM or properly configured.
Click to expand...
Click to collapse
Agreed. I still have my old Galaxy Apollo, with 256 MB ram it goes perfectly as it should. In fact, on a careful observation i 've noticed that if we use taskkiller at autokill level at let's say 30 minutes autokill, it will technicall consume 4 CPU cycles in an hour for each app (two for killing, and two when applications like gmail/facebook etc. starts automatically again).. but without taskkiller they may have stay idle, and not used any CPU cycle at all for as many hours as phone is idle. And for battery purpose, it is the CPU cycle that drain, not the used memory !
in my opinion,we only need to kill the apps that use internet in background to save battery.such as Google Maps,once i used it,its services stay in background and after 3 hours i didn't use phone do anything,battery drain 3%,and if i kill it,no battery drain after all
Google Maps and DRM service process sometimes cause battery drains indeed.
knzo said:
Google Maps and DRM service process sometimes cause battery drains indeed.
Click to expand...
Click to collapse
i deleted DRM service,and seems it's no harm to system
Lol but do you know what is it function ?
Sent from my LG-P970 using xda premium
I've seen drm using a lot of CPU as well from time to time. What is it used for and how would you go about removing it?
dxdiag32 said:
i deleted DRM service,and seems it's no harm to system
Click to expand...
Click to collapse
Sent from my LG-P970 using XDA App
masterthor said:
I've seen drm using a lot of CPU as well from time to time. What is it used for and how would you go about removing it?
Sent from my LG-P970 using XDA App
Click to expand...
Click to collapse
You can use Titanium https://market.android.com/details?id=com.keramidas.TitaniumBackup
-Go to Backup/Restore tab
-Find by DRM Protected Content Storage
-Click and select Freeze
Now the app is Freeze and the system don't see more!
Just simply question guys,but I confuse about this
*swap enable/using swap partition
*using ext partition over moving apps2SD normally
Is this could be better than normal/standard SDCard?
I have Transcend 16GB Class 10 using fat32+ext4 (using link2sd)
But I felt not different with my VGen Class4 8GB
Please guys if you have experience about this,,tell whats wrong n what were I missed for
Thanks
Sent from my Spice Mi-410 using Tapatalk 2
Arya_3RDNumber said:
Just simply question guys,but I confuse about this
*swap enable/using swap partition
*using ext partition over moving apps2SD normally
Is this could be better than normal/standard SDCard?
I have Transcend 16GB Class 10 using fat32+ext4 (using link2sd)
But I felt not different with my VGen Class4 8GB
Please guys if you have experience about this,,tell whats wrong n what were I missed for
Thanks
Sent from my Spice Mi-410 using Tapatalk 2
Click to expand...
Click to collapse
I'll try to answer base from what I know....
"*swap enable/using swap partition"
About this, we have to know what is swap, swap type and do we need it?
swap is the another partition which will be used as an extra memory. As we know, memory is been accessed VERY OFTEN in a process, both read and write.
On linux PC commonly we use one partition on disk drive for linux swap. On windows it's using a file as a virtual memory.
Swap is needed when the application need large memory to be used for a process and the current ram is not enough. Well there are some priority list to be followed. Ok, I'll give an example if we run a big game in an android. we have ~350MB total user memory but let say we have 50MB free memory. Most of android BIG 3D games will not exceed 300MB of memory, the game designer will look to target phone which will run it, and they presume all user don't have swap memory. But let say the app will need about 300MB of memory to run.
1. If we have 50 MB swap partition in sdcard
Android will never deplete the real ram, so let say it will keep 10MB of free ram, it will be use for the android system rom to keep running. In this situation the app will take 40MB of free ram, 50MB of swap... and what about another 210MB? Android will take it from the real ram by kill another apps (based on priority of low memory killer setting) to reallocate the ram. So for the game, the real ram will be taken about 250MB and 50MB from swap and free ram about 10MB. another 90MB of real ram used by the system and another hidden app like framework setting, messaging and others and for app cache. About 250MB ram used by game app is accessed very fast, but 50MB of swap if very slow because of access speed of sdcard is very much slower then ram.
When exiting from the game, some hidden apps still in memory. Android will run one or two another residen apps.
2. If we have 50 MB swap zram
Zram is swap partition in real ram, not sdcard. Any data written to the zram is compressed and decompressed on the fly. For 50MB zram, let say we can get about 80MB swap because of compression. the ratio depend on data been compressed.
Just like said in point 1, android will keep 10MB of free ram for the android system rom to keep running. The app will take 40MB of free ram, 80MB of swap. The real ram is 350MB - 50MB(zram) = 300MB, 290MB will be available for apps. The app will take 80MB from zram, and use 220MB from real ram. So 290 - 220 = 70MB of ram will used by android system and for app cache.
About speed of game between those 2 swap type, zram will be faster for sure because it use ram rather then sdcard. And one thing I feel necessary to let you know. Not as in PC which using HDD as storage which almost has unlimited write cycle. But we use SDCARD which has very limited write cycle. So consider using swap partition in your sdcard, even if it has very fast write/read speed. It will significantly affect your sdcard life.
When exited from the game, few hidden app still reside in memory. Android will run few another residen apps.
3. If we not use any swap
The game will take 300MB of ram, and let 40MB of ram used by android system. More apps have to be killed by android low memory killer system.
When exited from the game, only one or two hidden app still reside in memory. Android will run some more another residen apps.
It's your decision to use swap or not. The need is depend on your behave of use of this phone and the types of apps installed, such as more widgets, tools and some residen apps. Try every option, and you will get the result. The result could be different with another user, depend on behave and the apps installed.
*using ext partition over moving apps2SD normally
If you really have your internal storage depleted, let say you have installed hundreds of apps, then yes you will need app2SD or ext partition on sdcard.
The read and write speed of internal storage and sdcard will definitely win by internal storage (You have class 10 of sdcard? just test the write speed of internal storage).
ext partition is access directly while app2SD using 3rd app, so using ext partition should be faster then app2SD.
Just 1.5 cents....
Do you understand what I've talked about???? Well.... I don't!!!
I'm a noob and it cracks my skull. Great explanation though:good:
wow??!! great explanation agan master
well I understand very much after read 1000times
Thanks a lot gan,,I must little experiment to realize
Now I understand what is "ZRAM" (sorry I really noobie )
about all this case,,is ZIPALIGN also complicate?
Well... actually my explanation hasn't completed yet. I was mentioned about priority, I didn't explained it. It about low memory killer configuration and also the priority of using swap. You can Google that .
About zipalign, it related with apk files. It intended to make it faster to load. Apk file is a compressed file. But I don't have any further knowledge regarding this. May be someone can explain it.
Sent from my bike using Tapatalk 2
Can anyone help me find, what is actually swap space means??
Swap space is a reserved space on a harddrive that acts as a "extended" RAM. When the RAM memory is full the kernel move stuff from the RAM memory to the Swap partition to free up memory. The data is later stored in the Swap until it's needed again.
The same thing or similar at least on a Windows pc is pagefile.
There are some discussions if swap files should be used or not on flash based storage devices since it increase the read/write cycles to the storage device and there by would break it faster (since flash based storage devices have a maximum of read/write cycles).
lintz said:
Swap space is a reserved space on a harddrive that acts as a "extended" RAM. When the RAM memory is full the kernel move stuff from the RAM memory to the Swap partition to free up memory. The data is later stored in the Swap until it's needed again.
The same thing or similar at least on a Windows pc is pagefile.
There are some discussions if swap files should be used or not on flash based storage devices since it increase the read/write cycles to the storage device and there by would break it faster (since flash based storage devices have a maximum of read/write cycles).
Click to expand...
Click to collapse
wow..thats a good piece of information.thanks mate +1
W/O swap
When low memory occurs kernel kill processes
With Swap
Kernel move those about to be killed process to swap space and then map them pointer with RAM so when you open that app instead of allocating new memory to psycial RAM its been read from Swap and loaded to RAM.
As mentioned many times creating swap file and/or swap partition to flash drive aka our phone memory(internal storage) is not a wise choice cause recursive read and write can damage that nodes in longer run as flash memory has limited read/write cycles.
Other choice is to make swapfile and/or partition to external mmc but as external mmmc has which could also damage mmc in longer run but it could be replaced cheap rather than internal flash memory. Issue arises with external c swapfile and/or partition is slower read and write which could degrade performance
So one for-all if swap is needed than CompCache/Zram is a wise choice which uses physical reserved RAM portion for swap. Which uses extemsive CPU to compress data and write them to swap and retrive them by decompressing and writing back to physical RAM. Which is not harmful but can use more battery and obviously its faster than swap on external mmc. Usually its faster in the beginning and slight laggy after more hours and days usage
Sent from my LG-P990 using Tapatalk 2
spica1234 said:
W/O swap
When low memory occurs kernel kill processes
With Swap
Kernel move those about to be killed process to swap space and then map them pointer with RAM so when you open that app instead of allocating new memory to psycial RAM its been read from Swap and loaded to RAM.
As mentioned many times creating swap file and/or swap partition to flash drive aka our phone memory(internal storage) is not a wise choice cause recursive read and write can damage that nodes in longer run as flash memory has limited read/write cycles.
Other choice is to make swapfile and/or partition to external mmc but as external mmmc has which could also damage mmc in longer run but it could be replaced cheap rather than internal flash memory. Issue arises with external c swapfile and/or partition is slower read and write which could degrade performance
So one for-all if swap is needed than CompCache/Zram is a wise choice which uses physical reserved RAM portion for swap. Which uses extemsive CPU to compress data and write them to swap and retrive them by decompressing and writing back to physical RAM. Which is not harmful but can use more battery and obviously its faster than swap on external mmc. Usually its faster in the beginning and slight laggy after more hours and days usage
Sent from my LG-P990 using Tapatalk 2
Click to expand...
Click to collapse
yh...this is actually what Iam looking for..thank you Spica it helped me a lot...So which is more harm less? swapfile,ZRam or CompCache?
basimsherif3 said:
yh...this is actually what Iam looking for..thank you Spica it helped me a lot...So which is more harm less? swapfile,ZRam or CompCache?
Click to expand...
Click to collapse
Compcache or zram which is fastest amongst swap
Sent from my LG-P990 using Tapatalk 2
So in cm7, if compcache/zram is disabled, will it use swap?
aldyu said:
So in cm7, if compcache/zram is disabled, will it use swap?
Click to expand...
Click to collapse
No untill and unless you have created swapfile and/or partition with an init.d startup script
Sent from my LG-P990 using Tapatalk 2
I need a app that freeze apps and make my ram low so I can have more memory some times apps are running when am not even using them I have been using ram manger pro and ram boost but the thing is that on ram boost it don't auto boost so is there any thing I can do
Sent from my SGH-I897 using xda app-developers app
To be perfectly frank, relax a little bit about it. When you see those apps loaded into memory, that's actually a good thing.
What's happening is that the Dalvik app, which is where Android's memory management tool is located, loads apps into memory where it can pull them up quickly. It takes less time for Dalvik to take an app that is loaded in memory and start it up for use than it does for it to pull it from storage, allocate memory, and start it.
Dalvik is usually pretty good about memory allocation, too, so if a program that needs more RAM appears, it will unload other programs from memory to provide the necessary space.
Any memory that isn't loaded with an app is, ultimately, wasted, as Dalvik will clear room as necessary. If you have a lot of memory available, that's all memory that could be used to load apps faster, giving you a better user experience.
If you have a custom kernel on your device, you should be able to find some tools to tweak how Dalvik handles the system (e.g. how much memory it allocates to each app, how it handles the ramping up/down of the processor speed, etc).
But am having heating issues on the phone
Sent from my SGH-I897 using xda app-developers app
IMO, Heating issues can be caused by an app overtaking the processor. that should be where most of your heat is generated anyways, not from the RAM. ON that note, Titanium Back will allow you to Freeze apps.
Rom toolbox (free or paid version) is an invaluable tool also
Sent from Mars via Curiosity
I understand the apps in the memory being useful part. What confuses and does turn it into an issue is that when you have many apps installed there is many in the memory. So if you are running a couple things and have many apps and the phone runs down to say 35-40mb ish then it sometimes starts to choke. But old phones with slower processors and less ram can go down to 20mbish. Is that just the standard cut off in most ROMs where its starts automatically freeing memory?
Sent from my SGH-I897 using xda app-developers app
Hi,
I was looking for and answer, but i can find anything.
So i have 2 questions about swap.
1. Can i have multiple swap files? Like eg. Zram+other swap file? Or two swap files (one on /cache other on /sdcard). Made via 2 apps. One (on internal memory/sdext) would be working all the time, second (sscard) only if i had needed it.
2. Is it possible to lock app in swap? I mean that app should only work using swap - no real ram. I was thinking about music player or some widgets.
Romio.se4m said:
Hi,
I was looking for and answer, but i can find anything.
So i have 2 questions about swap.
1. Can i have multiple swap files? Like eg. Zram+other swap file? Or two swap files (one on /cache other on /sdcard).
Click to expand...
Click to collapse
I think it's possible to activate swap partition + swap file at once, but why you should do that?
You can create swap partition up to 4096 mb OR swap file up to 4096 mb using" ram expander" app from market.
-zram is ram compressor which slows down the device
Made via 2 apps. One (on internal memory/sdext) would be working all the time, second (sscard) only if i had needed it.
Click to expand...
Click to collapse
I didn't understand you, u wanna use internal memory as swap or install swapping app in internal?
(Cm9 roms use internal as swap partitions)
2. Is it possible to lock app in swap? I mean that app should only work using swap - no real ram. I was thinking about music player or some widgets.
Click to expand...
Click to collapse
I never heard something like locking app in swap but might be possible with some advanced RAM managers.
Sent From My BEAST , I mean X8
i guess u can have multiple swaps but you cannot have swap controlled by multiple apps.
kernel should find all swap places and should work according to them.
and u can increase swappiness to lock apps which are not active into swap.
but x8 internal memory is very slow.
our ram r/w speed is about 550MBps
and internal memory speed about 2mbps
so using swap other than zram is not really a good option.
also zram has disadvantages as it uses ram only and increases cpu overhead.
You can have any number of swap partitions or file that you like. Linux will do the job of distributing the swapped data to them and you can sit back and relax. Mind that only way this makes sense is if you got a fast enough sdcard.
Sent from my Galaxy Nexus using xda app-developers app