ok so i didnt really know what swap was or compcache with backing was so i spent the day lookin it up and i just want to know if what im getting out of my info is correct.
swap, basically instead of your phone just seeing ram it also sees your swap partition as part of the ram. so it stores app data and etc. to the swap partition thus making your phone run faster and not taking up all your internal ram and make it run slower. and it is managed by linux. by changing your swappiness setting either higher or lower will change how often swap is used.
compcache, basically creates a sort of swap partition inside the ram itself. it compresses what it swaps into this partition to create more space in the ram. im guessing people like this with backing swap because the compressed info can be brought up quicker because its compressed in the phones ram rather than like swap were its on the sd.
backing swap, when compcache is full it uses the swap partition on my sd. but rather than being like linux swap were its controlled by linux, backing swap is managed by compcahe wich works together better than compcache and linux swap.
im a complete noob here lol so if i got something wrong you gotta explain it to me in laymans terms thanx for the help
Yes, that's right. Did you copy and paste those definitions lol?
lol no i did a lot of google searching its all other peoples info but i put it into words that i can understand.lol
Amack that almost deserve a sticky
this post help me understand the way the partition works alittle better now, thanks!
Related
I've been searching and haven't really found a definitive thread or answer...
I'm using CM 4.1.999 currently (4.0.4 previously) with linux-swap exclusively, and have tried other ROMs as well.
Right now I have an 8gb class 6 SD with 4 partitions: FAT32 remainder, 500MB ext3, ~40MB linux-swap, and ~200MB linux-swap. I created the two swap partitions as several of the threads I've read adamantly state not to go above 32MB (without explanation), but others also adamantly state to use about 200MB for Hero ROMs.
So, my question is, which is it, and why? Why the 32MB limit? Why not 196MB? Why the disparity between "basic" ROM recommendations and Hero ROM recommendations? Besides "it goes slower", is there an answer to why specifically it causes it to perform slower with certain ROM types, and is there a way to mitigate it?
Also, regarding swappiness, how do we calibrate it? What does swappiness mean? I've seen that in user.conf the default is 60, but I've seen some people use 32MB swap partitions with 40 swappiness, or 200MB with 100 swappiness, as well as 96MB with 80 swappiness. So, which is it, and how do we know what is right for us besides countless iterations of setting, rebooting, testing, setting, rebooting, testing, etc..?
If I missed a link or thread somewhere with the information I'm looking for, please let me know so I can do my research ; ) A simple explanation or recommendation would be key, though... just trying to learn as much as I can!
Thanks! As a long-time XDA user, I still appreciate the community involvement and innovation that happens here!!
I have never seen ANYWHERE where it asks for 200mb swap partitions. having two swap partitions does absolutely nothing for you.
the 32mb limits were imposed due to stability. However, you should use 64 or 96mb for hero roms.
anything more may cause unnecessary instability
Swappiness just refers to how often the phone will write to the swap file (the tendency for the ROM to place data on the swap) the higher the number, the more likely data will be sent to the swap partition. anywhere from 30-80 is ok.
If youd like to learn more about good swap settings, go to the user.conf threads in the dev section where they discuss performance benefits/hits from different configurations
Excellent, thanks!
I've looked at the user.conf thread and seen several recommendations, but had not seen a single definitive "these are the best agreed-upon settings"..
I'd think that since the hardware is the same, we should be able to say, "With SPL x and ROM y on Device z, these settings are ideal" -- but I haven't seen that.
I kept two swap partitions in case I switched to a Hero ROM in the future so I wouldn't have to repartition again..
Are there major stability issues if I were to use a 64 or 96MB swap with a non-Hero ROM? I don't understand why it's OK with Hero, but not with others... why the disparity?
grivad said:
Excellent, thanks!
I've looked at the user.conf thread and seen several recommendations, but had not seen a single definitive "these are the best agreed-upon settings"..
I'd think that since the hardware is the same, we should be able to say, "With SPL x and ROM y on Device z, these settings are ideal" -- but I haven't seen that.
I kept two swap partitions in case I switched to a Hero ROM in the future so I wouldn't have to repartition again..
Are there major stability issues if I were to use a 64 or 96MB swap with a non-Hero ROM? I don't understand why it's OK with Hero, but not with others... why the disparity?
Click to expand...
Click to collapse
I dont like repartitioning either haha but i use 96mb on cyan's rom (i switch between hero and cyan) I havent had any issues with them
the 32mb limit was more or less an experimental guess made quite a while ago. it seems dated.
make sure you only have 1 swap partition. that could potentially cause problems
So you should be fine with 64-96mb
the reason there is no definitive setting that maximizes performance is due to differences in ROM's. What works on one rom may not work so well in another. Also, many people perceive the speed of their settings differently and suggest what they believe to be fast.
The best way to find what works best for you is to experiment with different settings and see what matches your needs
Thanks for the info!
Per your comments, I repartitioned with one swap partition set at 96MB..
Previously I had a 32MB partition with swappiness at 30 and it ran lickety split. Now that I've gone to 96MB, I increased swappiness to 60 and I'm seeing some weird performance issues..
Do you have a recommendation for the swappiness value for a 96MB swap partition?
Im new to all this swapping stuff etc. so sorry if this is a stupid question. When i type the free command I see that my phone memory is also almsot used up with like 1000-3000k being frees and my swap memory only being half way used (i set it to 64 mb) is there a way i can make the swap be the primary source of memory?
Hope that made sense, Thanks in advance!
No, you can't set virtual memory to have the priority. If you have a user.conf and userinit.sh you can change the swappiness value, which I'm assuming would mean more virtual memory is utilized.
yeah.. knowing basic knowledge of computer stuff.. its used for memory and stuff.. but what is the point of having it for ROM's?
I use 192MB of Swap.. how will that effect anything..
There is a TONNE of information already on this...
The search button is your friend.
ElChibo said:
yeah.. knowing basic knowledge of computer stuff.. its used for memory and stuff.. but what is the point of having it for ROM's?
I use 192MB of Swap.. how will that effect anything..
Click to expand...
Click to collapse
It allows you to keep more processes active in memory by using disk space as fake memory, thus increasing the load on your CPU and slowing it way down.
If you like your phone slow, enable swap. If you like it fast, don't.
i might be way off on this but im just being cautious. I decided i was gonna replace the 4gig class 2 sd that comes w/ the nexus with the 4gig class 6 i had in my g1. i decided to use my g1 to format the nexus sd card but noticed 1 thing i guess i just dont understand. When i dropped into parted with the nexus sd card i typed "print" just to see if it was only 1 partition but what i seen was this
Number___Start_______End_________Size______Type_____File System
___1____4194kB_____3965MB_____3961MB_____Primary______fat32
can someone explain to me what would be from 0-4194kB and also how the end size is bigger than the complete size. If that is how its supp to be and im just misunderstanding then please update me on how it actually works or if ive noticed something that needed to be pointed out.
Thanks, veritasaequita
3961MB + 4194kb = 3965MB, the "End" Size is just an Index. Partition starts at 4M, is 3961 MB in size, so it ends at 3965M
About the missing 4M at the start, I'll take a quick look at it.
EDIT:
Looks like all zero to me, if you substract the mbr from the first 4MB. Perhaps somebody at google did some clever aligning? but then 4mb would be huuuuuge
thats kinda what i was thinking, actually my first thought was if it was a 4mb sorta kinda "swap type partition" for performance....prolly not though. im a perfectionist so im not gonna swap cards until i can fig out what or where those 4mb are and have them on my new card....i dunno my ears are smoking now...lol
veritas
well you can always just dd the old card to the new one and then enlarge the fat partition (or in your case: just omit the last step )
but why make such a fuss about 4mb of zeros? i've seen lots of strangely partitioned usb-sticks/flash disks --and-- a lot of people use other cards in ther n1's (because of the crappy size the n1 ships with). if you must you can always make a dd to a new card or store the dump somewhere for restore later (or just put the old card somewhere safe?).
but still, that seems paranoid and not perfectionistic... don't worry so much
ps: yeah, swap with 4mb wouldn't help much and on the other hand they would just mark it as "swap" in the partition table if it were the case.
im following, thanks for the insight bro
veritas
Just a guess, but most modern hard drives have a hardware cache at the start of the disk. i.e 8MB, 16MB, 32MB etc.
Maybe your SD card uses 4MB.
Also, the manufacturers use the non-technical "Billion Bytes" instead of "Giga Bytes" in the fine print. 4000000000 B (Billion Bytes) = 3814 MB
nope, cache would be invisible by definition.
also the 4mb are there just not allocated to any partition. this has nothing to do with how you calculate the size of the disk.
Just out of curiosity could there ever be a possible way someone like perhaps google could store something hidden to everyone else in that 4mb for maybe like a factory backup of the file system or a backup bootloader? Just exercising my brain, thats all...lol
It's nothing basically, all the hard drives in your PC will have a few meg space you can't partition.
veritasaequita said:
Just out of curiosity could there ever be a possible way someone like perhaps google could store something hidden to everyone else in that 4mb for maybe like a factory backup of the file system or a backup bootloader? Just exercising my brain, thats all...lol
Click to expand...
Click to collapse
well of course you can store something there and if the IPL of the phone can access the sd card it certainly could execute that or flash something. there is a broad range of possibilities what you could and couldn't to with the 4 meg (a factory backup would be a little bigger ) and a backup bootloader wouldn't make sense, because you can feed something to the current loader directly. if you do anything worse to the phone like erasing the IPL, well thats what JTAG is for, just program the chips directly.
so of course this could be an evil tracking cookie and we all could get even more paranoid, but still its all zero's and not really "hidden" in any way, just not allocated and directly visible.
what i want to say: every facebook or other kind of web 2.0 shouldn't be worried about 4 unexplainable megs on some sd card
Sry if this has been asked before as I'm a newb but is there a way to use virtual memory or create a swap partition like in ubuntu to be used when memory runs low. My wife has this phone (htc hero-cdma) and is always complaining how it's so slow and how much she hates it. i believe it is due to ram running low as I have already overclocked to 768 mhz and running froyo which did make it faster but it still slows down. And untill I have the money to get her own htc evo I at least want to make it bareable. any help would be appreciated.
You have to be running a rom that supports it - read each ones details and it will tell you. I think most of the 2.1's do.
But to set it up - when you are in recovery partition your SDCard. It asks how much for Swap/Ext remainder is Fat.
Too much Swap tends to slow things down though.
Kcarpenter said:
You have to be running a rom that supports it - read each ones details and it will tell you. I think most of the 2.1's do.
But to set it up - when you are in recovery partition your SDCard. It asks how much for Swap/Ext remainder is Fat.
Too much Swap tends to slow things down though.
Click to expand...
Click to collapse
Thanks for the reply. She is running cyanogen 6.0.0 rc1. Ill look into the notes to see if there is anything about adding a swap file under cyanogen. Btw if I add a partition for swap what should it be? Ext2 or ext3, how much is recommended and once done will the phone reconize automaticly? Thanks for help.