Compcache + Swap - Sorry guys.... - G1 Q&A, Help & Troubleshooting

Sorry for posting another question relating to this.. I'm having a heck of a time trying to wrap me head around...
ROM: Cyanogen 4.2.10.1
I have a 4GB class 6 SD card in my phone partitioned (rounded):
3300MB fat32
500MB ext3
200MB swap
I'm have the userinit.sh in /system/sd as
Code:
#!/system/bin/bash
#
partition=3 #partition number of swap partition. Change if swap is not partition 3.
mem_limit_kb=14688 #default 14688 (15%). Range 0 - [size of swap partition], larger number = less 'normal' RAM, more 'swap' RAM
swappy=30 #swappiness. larger number = more likely to swap, smaller number = less likely to swap
modprobe ramzswap;
rzscontrol /dev/block/ramzswap0 --backing_swap=/dev/block/mmcblk0p$partition --memlimit_kb=$mem_limit --init;
swapon /dev/block/ramzswap0;
sysctl -w vm.swappiness=$swappy;
exit 0;
as per the Cyanogen wiki...
If I run "free" from the terminal I get
Code:
free
total used free shared buffers
Mem: 97924 96448 1476 0 2940
Swap: 24472 12940 11532
Total: 122396 109388 13008
What I'm having trouble understanding is "mem_limit_kb=14688". What memory is it referring to? The built in RAM?
If so, does that mean to put active programs into the remaning 80MB of RAM and store the "images/pages" of inactive applications into the 14688KB of reserved RAM for Compcache? After the 14688KB of Compcache is filled, should it not then dump everything to the Swap?
The reason I'm confused is that I have 200MB of swap partition, and yet I still load up the browser from memory and it reloads pages... Or is it reloading the page, just this time from a local cache (which would be silly)?
Finally, what exactly does "swappiness. larger number = more likely to swap, smaller number = less likely to swap" actually mean? I don't really understand that at all...

Its not a good idea having both enabled in the user.conf..One will be set as back swap while the other is be set to 1.

To be honest I have no idea.. heh. I just copied it from the Wiki.. To me it made a bit of sense running both... Compache to be first since it should be a bit faster than swap... Atleast that's how I saw it...

Related

JFv1.51 Vs Hero memory Usage?

So i was using JACHero 2.63(the fastest of the Hero ROMs) and i still can't stand the lag. Before everyone suggests i format the card and make sure i have a linux-swap partition. I did that...and it is the fastest version i have found. But still to slow on certain things. There are times when i can't even see who is calling before the call is placed in voicemail.
But enough of that, i was wondering if anyone knows exactly why its so slow? I ran cat /proc/meminfo and free in terminal and if i remember correctly the same amount of ram was free on both JAC2.63 and JF1.51, there may have been a Mb difference but not something i thought would be a big deal. Now from what i have read i believe the HTC Hero has the same CPU but double the storage and memory. So i would think its a memory problem...but if both versions show the same amount of memory free wouldn't both be laggy as the other?
I maybe missing something but just wanted to try and see if i could get some answers.
Anyone?
More stuff is running in the background at all times in Hero ROMS than in JF ROMS. If you run a task manager you will see that there are alot more services running than in JF ROMS. Also Rosie runs in the background and uses alot of memory no matter how optimized because it searches for widgets. My only suggestion would be to like you said reformat sd card with the 3 partitions and also make sure you have a class 6 sd card. If it's still slow try cleaning up Rosie and modifying the build/removing all unnecessary widgets. There's a modified Rosie, 333kb compared to the ~600+ kb available at leakdroid.com Hope that helped.
Having more stuff in the background running will cause more RAM Usage. but i didn't see it. Can someone who is running JACHero 2.63 reboot the phone and once it is up and running, go to Terminal and run
Code:
cat /proc/meminfo
and post that info. Also in terminal run
Code:
free
JF1.51 meminfo:
Memtotal: 98668 kB
Memfree: 3892 kB
JF1.51 free:
Memtotal: 98668
Used: 97132
Free: 1536
damnitpud said:
Having more stuff in the background running will cause more RAM Usage. but i didn't see it. Can someone who is running JACHero 2.63 reboot the phone and once it is up and running, go to Terminal and run
Code:
cat /proc/meminfo
and post that info. Also in terminal run
Code:
free
JF1.51 meminfo:
Memtotal: 98668 kB
Memfree: 3892 kB
JF1.51 free:
Memtotal: 98668
Used: 97132
Free: 1536
Click to expand...
Click to collapse
sure give me a second
EDIT:
JACHero2.63:
cat /proc/meminfo
MemTotal: 98328 kB
MemFree: 2960 kB
Buffers: 140 kB
Cached: 23544 kB
SwapCached: 2060 kB
Active: 37880 kB
Inactive: 43604 kB
Active(anon): 29372 kB
Inactive(anon): 29524 kB
Active(file): 8508 kB
Inactive(file): 14080 kB
Unevictable: 948 kB
Mlocked: 0 kB
SwapTotal: 31440 kB
SwapFree: 26832 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 57000 kB
Mapped: 14584 kB
Slab: 3976 kB
SReclaimable: 984 kB
SUnreclaim: 2992 kB
PageTables: 5048 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 80604 kB
Committed_AS: 1511656 kB
VmallocTotal: 155648 kB
VmallocUsed: 61248 kB
VmallocChunk: 33788 kB
JACHero2.63:
free
total used free shared buffers
Mem: 98328 96544 1784 0 140
Swap: 31440 4608 26832
Total: 129768 101152 28616
Thanks, alritewhadeva i have some research to do. i'm not sure those tests are giving the right values. Your total is different then mine.
If they are correct i don't see why JF1.51 would be running much faster...the difference in memory doesn't seem like enough to cause lagginess...I could be wrong i guess...maybe those small amounts are huge in mobiles?
damnitpud said:
Thanks, alritewhadeva i have some research to do. i'm not sure those tests are giving the right values. Your total is different then mine.
If they are correct i don't see why JF1.51 would be running much faster...the difference in memory doesn't seem like enough to cause lagginess...I could be wrong i guess...maybe those small amounts are huge in mobiles?
Click to expand...
Click to collapse
Linux will fill the memory as close to 100% used as it possibly can.. Things load faster from memory, so it keeps everything it possibly can in RAM. Free memory is wasted memory.
So as long as there isn't something grossly wrong with the memory management in a ROM, they should all be pretty similar when you look at "free."
The difference is, in a lighter ROM like JF or Cyanogen, more of the actual framework fits in RAM under normal use, so you can access it quickly. In Hero, the framework is larger so parts of it don't fit and get swapped out - causing lag.
Saiboogu said:
Linux will fill the memory as close to 100% used as it possibly can.. Things load faster from memory, so it keeps everything it possibly can in RAM. Free memory is wasted memory.
So as long as there isn't something grossly wrong with the memory management in a ROM, they should all be pretty similar when you look at "free."
The difference is, in a lighter ROM like JF or Cyanogen, more of the actual framework fits in RAM under normal use, so you can access it quickly. In Hero, the framework is larger so parts of it don't fit and get swapped out - causing lag.
Click to expand...
Click to collapse
That's what i was starting to think, thanks for the info Saiboogu.

question about changing swappiness

OK so i have v3r2 with 96 mb linux swap and it worked fine in the beginning...but now its straight up slow and i need all my widgets so...by default i have 30 swappiness and i heard in a thread that having 60 swappiness helps...I dont know anything about adb (dont have that much time,) so i just need to know how to change the swappiness setting...preferably if i can do it in console or terminal emulator
I use Swapper personally, but im on JF 1.51. I heard 60 was the sweet spot on Cyan roms by default for swappiness. Then using a 32mb linux-swap partition (and thus 32mb) for swap.
Otherwise if your not on Cyans and are like I am on JF. The ideal setting that works well is 32 swap (using the partition) and 10 swappiness.
More then that just asks for trouble. compcache I wouldnt use personally either btw, its slower then a linux-swap setup it seems.

Compcache / Linux-swap

Run sh /system/bin/swap -s to check swap status and other mod values.
Ok so I did this to check on my stuff, cause i wanted to make a compcache.
*** CompCache ***
compcache_en=0
cc_memlimit=16
cc_disksize=32
cc_backingswap_en=0
cc_backingswap=/dev/block/mmcblk0p3
swappiness=30
*** Linux Swap ***
linux_swap_en=1
linux_swap_partition=/dev/block/mmcblk0p3
....................
=== Linux Swap status ===
Linux SWAP enabled on /dev/block/mmcblk0p3
Linux Swap: swappiness - 30(system) 30(user)
i'm running JACxHEROSkiv1.5r2 and want to know what I can do to inprove the speed of the ROM.
Any suggestions are welcome i'm not much of a programmer
Looks nlike you need to edit the"cc_disksize=32" value, but I doubt that affect the speed tbh.
What size swap partition are you running?
Im running with 96 MB linux swap
btw what is that (cc_disksize=32) ?? the linux swap size ?
I read i a couple of posts about the linux swap and compcache and read that if you enable comcache it could speed up your device slightly.
YuYe said:
Im running with 96 MB linux swap
btw what is that (cc_disksize=32) ?? the linux swap size ?
I read i a couple of posts about the linux swap and compcache and read that if you enable comcache it could speed up your device slightly.
Click to expand...
Click to collapse
Ah thought CC was already enabled.
compcache_en=0 < This needs to be changed to one to enable CC.
cc_disksize=32 < That's the CC size, I wouldnt change it.
I would *strongly* recommend reducing your swap size. It seems to be that the bigger the size, the faster it is at first, but then the phone starts to get really slow. Go for 48 or 64mb.
I don't really know a lot about CC, I've never edited the config files for it as it's generally set up for optimum performance already (and I also don't like the idea of it wearing out the nand). If you look in the xHero there are other configurations for CC, CC+swap, swap, CC +backing swap that you may want to look at.
twistedUmbrella said:
Alright. Ran a 96 mb swap all day to test. Load screen about equal. It was "ghost lag" where you do something and it freezes for a minute
Click to expand...
Click to collapse
Ok then i better change the size of my swap. also does it matter if your on ext3 or 4 ?
And what is the difference between linuxswap and compcache ?
Sorry for these noob questions but I'm a bit lost
YuYe said:
Ok then i better change the size of my swap. also does it matter if your on ext3 or 4 ?
And what is the difference between linuxswap and compcache ?
Sorry for these noob questions but I'm a bit lost
Click to expand...
Click to collapse
no ext doesn't matter.
Compressing pages and keeping them in RAM virtually increases its capacity. This allows more applications to fit in given amount of memory.
Click to expand...
Click to collapse
The problem is the Hero UI is quite CPU intensive, so less CPU power can be devoted to compressing/decompressing files in RAM.
Linux-swap is a separate partition where files are paged, increasing the amount of memory. The difference being it's outside the RAM.

can someone tell me if my thinking is correct

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!

Question about swap and internal G1 memory

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.

Categories

Resources