getting swapfile working on /data partition - G1 Android Development

Im trying out a theory. I running JAC Hero 2.3 and wanna try running the swapfile on the /data partition. I moved app_s over to /system/sd and used swapper app to create the swapfile but android doesnt seem to use it. when i run free It says Total/used/free are all 0 but the swap file is 34 meg. I tried putting it in a sub folder and chown root.root on the folder before setting up and still no luck. Anyone have any ideas why it wont work on /data or how to get it to work on /data?

Once you run swapper go into the setting and change the location of your swap file from /sdcard/swapfile.swp to /system/sd/swap.swp ( see sxfx post[url]

you don't want to do that. Swapping involves a lot of writing and erasing, it'll wear out your internal chip and you'll start experiencing reduced capacity, write cycles for nand are even less than for flash memory!

jubeh said:
you don't want to do that. Swapping involves a lot of writing and erasing, it'll wear out your internal chip and you'll start experiencing reduced capacity, write cycles for nand are even less than for flash memory!
Click to expand...
Click to collapse
not to mention, swapon as implemented (on every build i've tried) doesn't work on a swapfile stored on a yaffs2 partition

jubeh said:
you don't want to do that. Swapping involves a lot of writing and erasing, it'll wear out your internal chip and you'll start experiencing reduced capacity, write cycles for nand are even less than for flash memory!
Click to expand...
Click to collapse
Actually /sdcard/ is your fat32 portion of your sd card, /system/sd/ is the ext2/3 of your sd card.
Also I have done a bunch of research on this write/read fiasco just because of android.
And even if you set a swap file to your SD sure it will shorten your life of the card but it will still last you at least 2 years.
I have been using USB devices on linux as swap locations forever now and I still have thumb drives that have been used and abused for months and months as a swap place and they are still pulling strong.
As for the internal chip, Im not sure what you mean by that?

Even if you could put swap on the internal flash, its not going to be faster.
Putting swap on the internal flash will make things slower as the internal flash is about 3 to 5 times slower than a class 6 sdcard.

you're comparing using a flash drive for swap in a full blown computer that probably has around 1-4gb of ram, the swap file is hardly ever touched, unless you're running a lot of applications at a time. Dream has only 90 mb available to dalvik, and rosie is a big fat... lady... plus linux/dalvik manage memory in a different way, so files are often dropped to swap and they dont stay there for long (maybe in a 256 swap, but not in a 32 mb one).
the OP also is talking about moving his swap to his internal storage (chip, nand, whatever), as he thinks it's having no effect working from the sd card. Personally, i think that both a2sd and swapper are flawed. They're overcompensating for an os that was not meant to run on that device, and the real work should be in porting (as in developing, not just file-swapping as most "devs" do here) a launcher app that we can feel comfortable with running on a stock android system with stock (or slightly improved) libraries and that we can call comparable to rosie. Just look at ahome or dxtop or openhome, they're good, solid, great looking home replacements that work as well or better than rosie, but they run out of the stock libraries. I wonder why nobody has made a free, open source home replacement app yet

jubeh said:
you're comparing using a flash drive for swap in a full blown computer that probably has around 1-4gb of ram, the swap file is hardly ever touched, unless you're running a lot of applications at a time. Dream has only 90 mb available to dalvik, and rosie is a big fat... lady... plus linux/dalvik manage memory in a different way, so files are often dropped to swap and they dont stay there for long (maybe in a 256 swap, but not in a 32 mb one).
the OP also is talking about moving his swap to his internal storage (chip, nand, whatever), as he thinks it's having no effect working from the sd card. Personally, i think that both a2sd and swapper are flawed. They're overcompensating for an os that was not meant to run on that device, and the real work should be in porting (as in developing, not just file-swapping as most "devs" do here) a launcher app that we can feel comfortable with running on a stock android system with stock (or slightly improved) libraries and that we can call comparable to rosie. Just look at ahome or dxtop or openhome, they're good, solid, great looking home replacements that work as well or better than rosie, but they run out of the stock libraries. I wonder why nobody has made a free, open source home replacement app yet
Click to expand...
Click to collapse
You make a very good point about computer having 1-4gigs of ram and not needing a swap file.
Honestly I almost never run a swap file on a computer that has more then 1gig of ram.
Plus90% of the time when I do run a swap file is when Im running a live distro of linux of a cd, but also 90% of the time I run the distro from the flash drive instead of cd cause its much faster.
So now imagine how many reads/writes I abuse that flash drive with by running a full OS on it.
Also I don't understand how a2sd or swapper is flawed? Just because they do their job? I mean it's not really our fault that they made the G1 with a little less memory spaces then we would like it to have.
But that's exactly why we have tools like swapper and a2sd. Plus no one is really forced to run these roms on the G1 phone and those of us that do realize that we have to take extra steps in creating tools to help it.
And that's not only true for the G1 but anywhere in the computer world these days.

dwang said:
Even if you could put swap on the internal flash, its not going to be faster.
Putting swap on the internal flash will make things slower as the internal flash is about 3 to 5 times slower than a class 6 sdcard.
Click to expand...
Click to collapse
I'd like to spread swap over the sd and internal storage if possible -- should make paging a lot less evident if priorities are set up properly.

dwang said:
Even if you could put swap on the internal flash, its not going to be faster.
Putting swap on the internal flash will make things slower as the internal flash is about 3 to 5 times slower than a class 6 sdcard.
Click to expand...
Click to collapse
internal memory is faster. class 6 guarantees 6mbs read/write times but doesnt mean the bus can support those times. if you run a test copying something to /system/sd and to /data you will see /data is faster. as for those saying it will degrade the internal memory, that is not the case being the flash memory inside is designed to have much much much more read/write cycles. Think about it in a stock G1, this is where dalvik-cache is writen to as well as email, sms, user settings, cache for browser and uTube. Do not confuse internal flash memory to sd card flash memory

Are you sure about that? This guy has some test results and it indicates that a class 6 sdcard is much faster than the internal flash.
http://forum.xda-developers.com/showpost.php?p=4059520&postcount=15
MonkySlap said:
internal memory is faster. class 6 guarantees 6mbs read/write times but doesnt mean the bus can support those times. if you run a test copying something to /system/sd and to /data you will see /data is faster. as for those saying it will degrade the internal memory, that is not the case being the flash memory inside is designed to have much much much more read/write cycles. Think about it in a stock G1, this is where dalvik-cache is writen to as well as email, sms, user settings, cache for browser and uTube. Do not confuse internal flash memory to sd card flash memory
Click to expand...
Click to collapse

dwang said:
Are you sure about that? This guy has some test results and it indicates that a class 6 sdcard is much faster than the internal flash.
http://forum.xda-developers.com/showpost.php?p=4059520&postcount=15
Click to expand...
Click to collapse
That's interesting. Going to have to try that test out. I just noticed when xfering stuff to /data it was faster then to /system/sd. If it is then touche my friend.....touche

Related

Is 32mb of Linux swap enough?

I know we are talking about a mobile OS here, but i remember the rule of thumb for Windows pagefile being 1.5 times the amount of ram...I am assuming the pagefile memory is similiar to the linux-swap. I could be wrong. So i did some searching and i found this on linux-swap.
The key question is how much? Older versions of Unix-type operating systems (such as Sun OS and Ultrix) demanded a swap space of two to three times that of physical memory. Modern implementations (such as Linux) don't require that much, but they can use it if you configure it. A rule of thumb is as follows: 1) for a desktop system, use a swap space of double system memory, as it will allow you to run a large number of applications (many of which may will be idle and easily swapped), making more RAM available for the active applications; 2) for a server, have a smaller amount of swap available (say half of physical memory) so that you have some flexibility for swapping when needed, but monitor the amount of swap space used and upgrade your RAM if necessary; 3) for older desktop machines (with say only 128MB), use as much swap space as you can spare, even up to 1GB.
[quote/]
So now we have 97,876 kb of memory showing in free. So should the linux swap be 48,938 kb or 48 mb instead of 32? Or because we have less then 128mb of memory should we follow the rule of giving it 1.5 (192 mb) times the amount of memory?
I am about to repartition my SDCard following the 1.5x rule. I have to research which commands to use to monitor swap...anyone know them off hand?
Edit:
I found this about making a swapfile instead of swap partition:
Swap file
As well as the swap partition, Linux also supports a swap file that you can create, prepare, and mount in a fashion similar to that of a swap partition. The advantage of swap files is that you don't need to find an empty partition or repartition a disk to add additional swap space.
To create a swap file, use the dd command to create an empty file. To create a 1GB file, type:
Code:
dd if=/dev/zero of=/swapfile bs=1024 count=1048576
I think the code needs to be changed. i am testing a few things now. I believe if=/dev/zero needs to be changed to something more amoung the lines of /dev/block/mmcblk0. Everything i try is getting a "dd: can't open '/swapfile': Read-only file system" I am assuming i have to mount it as rw but im not 100% on how to do that. Any help is appreciated.
Click to expand...
Click to collapse
/swapfile is the name of the swap file, and the count of 1048576 is the size in kilobytes (i.e. 1GB).
Prepare the swap file using mkswap just as you would a partition, but this time use the name of the swap file:
Code:
mkswap /swapfile
And similarly, mount it using the swapon command: swapon /swapfile.
The /etc/fstab entry for a swap file would look like this:
/swapfile none swap sw 0 0
Click to expand...
Click to collapse
Interesting, let me know if this helps with speed, I will definitely be using it.
Thats the plan =) I am going to repartition the sdcard now with the larger swap partition and then maybe down the line...we can switch from using a 3rd partition to using the swapfile instead.
I'm considering doing the same thing. What you posted makes sense. A bigger swap partition would free up ram for more active applications. Since I'm using a Hero Rom that would probably help haha.
I've already test this theory at swap partitions beyond 32MB including 48, 64, 192, up to 1gb at varying swap partition sizes. Also I tested multiple swappiness settings (20,30,40,60,80,100). The conclusion, bigger is not always better. The larger the swap partition became, the more the system had to swap out then back into memory, which took a hell of a lot of time (upwards of 5 minutes just to go from browser to home). General rule of thumb for swap files, just make a swap file the size that is enough, not one that is huge.
Good luck with your method of swap (which already exists, through methods like the app swapper), I know there are threads floating around where people use swap files, and end up switching to compcache or a swap partition because of higher stability.
andonnguyen said:
I've already test this theory at swap partitions beyond 32MB including 48, 64, 192, up to 1gb at varying swap partition sizes. Also I tested multiple swappiness settings (20,30,40,60,80,100). The conclusion, bigger is not always better. The larger the swap partition became, the more the system had to swap out then back into memory, which took a hell of a lot of time (upwards of 5 minutes just to go from browser to home). General rule of thumb for swap files, just make a swap file the size that is enough, not one that is huge.
Good luck with your method of swap (which already exists, through methods like the app swapper), I know there are threads floating around where people use swap files, and end up switching to compcache or a swap partition because of higher stability.
Click to expand...
Click to collapse
Ahh good to know, I tried searching for linux swap and not much came up so i didn't see any threads on this. The setup seemed to run faster, but that is part of Drizzy's v2.7 updates.
What commands did you use to watch the swap partition?
I was actually one of the first people I knew to put swap on the phone but I happen to know that the swapper application does that plus more! and even back in the day when I did it I couldn't use to much or my phone would lag! I recommend either 32mb or 64 mb of swap and just default swappiness but if you use swap I also recommend to underclock your phone to 383!
kickfliprock13 said:
I was actually one of the first people I knew to put swap on the phone but I happen to know that the swapper application does that plus more! and even back in the day when I did it I couldn't use to much or my phone would lag! I recommend either 32mb or 64 mb of swap and just default swappiness but if you use swap I also recommend to underclock your phone to 383!
Click to expand...
Click to collapse
I would only underclock if ur running hero...this seems to be the only rom underclocking really benefits you
damnitpud said:
Ahh good to know, I tried searching for linux swap and not much came up so i didn't see any threads on this. The setup seemed to run faster, but that is part of Drizzy's v2.7 updates.
What commands did you use to watch the swap partition?
Click to expand...
Click to collapse
in terminal type:
$free
it will show a section for swap. if it reads all zeros then the swap isn't being used.
Here's an example of my phone:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
You can see the difference of the swap being used, and the swap not being used.
damnitpud said:
I know we are talking about a mobile OS here, but i remember the rule of thumb for Windows pagefile being 1.5 times the amount of ram...I am assuming the pagefile memory is similiar to the linux-swap. I could be wrong. So i did some searching and i found this on linux-swap.
The key question is how much? Older versions of Unix-type operating systems (such as Sun OS and Ultrix) demanded a swap space of two to three times that of physical memory. Modern implementations (such as Linux) don't require that much, but they can use it if you configure it. A rule of thumb is as follows: 1) for a desktop system, use a swap space of double system memory, as it will allow you to run a large number of applications (many of which may will be idle and easily swapped), making more RAM available for the active applications; 2) for a server, have a smaller amount of swap available (say half of physical memory) so that you have some flexibility for swapping when needed, but monitor the amount of swap space used and upgrade your RAM if necessary; 3) for older desktop machines (with say only 128MB), use as much swap space as you can spare, even up to 1GB.
[quote/]
So now we have 97,876 kb of memory showing in free. So should the linux swap be 48,938 kb or 48 mb instead of 32? Or because we have less then 128mb of memory should we follow the rule of giving it 1.5 (192 mb) times the amount of memory?
I am about to repartition my SDCard following the 1.5x rule. I have to research which commands to use to monitor swap...anyone know them off hand?
Edit:
I found this about making a swapfile instead of swap partition:
Swap file
As well as the swap partition, Linux also supports a swap file that you can create, prepare, and mount in a fashion similar to that of a swap partition. The advantage of swap files is that you don't need to find an empty partition or repartition a disk to add additional swap space.
To create a swap file, use the dd command to create an empty file. To create a 1GB file, type:
Code:
dd if=/dev/zero of=/swapfile bs=1024 count=1048576
/swapfile is the name of the swap file, and the count of 1048576 is the size in kilobytes (i.e. 1GB).
Prepare the swap file using mkswap just as you would a partition, but this time use the name of the swap file:
Code:
mkswap /swapfile
And similarly, mount it using the swapon command: swapon /swapfile.
The /etc/fstab entry for a swap file would look like this:
/swapfile none swap sw 0 0
Click to expand...
Click to collapse
We switched from the swap file to the swap partition because it turned out that the swap partition was more stable wand was faster too. Also, we didn't have to set it up each time we flashed a new ROM and we could just have it activated by default. The problem with the swap file is that if you place it on the fat32 portion of your sdcard and then mount it to the computer, all hell breaks loose on your phone. I corrupted my card and was forced to re-partition everything because of that. As it is, I'm happy with my 32MB of swap with default swap of whatever the ROM dev chooses.
Click to expand...
Click to collapse
All this info is very good. Thank you everyone who replied. A lot of this info must be stashed away in an older thread somewhere no?
But after all this im going to give up on the swapfile and swap size. I do have a question for some of you that know more about this then me.
I want to run Hero after getting used to it. but after a few hours of running it, it slows down. i have followed every step the ROM devs have said and it still slows down. So i am wondering now, i noticed that Drizzy's ROM has an app and app_s folder in data. I am assuming that app_s is all the apps that go to the sdcard. But even a class 6 card is slower then the internal storage. So maybe moving apks like Rosie and some system apks to internal storage could speed up the way it Hero runs...am i wrong here or going down a path others have already tried?
damnitpud said:
All this info is very good. Thank you everyone who replied. A lot of this info must be stashed away in an older thread somewhere no?
But after all this im going to give up on the swapfile and swap size. I do have a question for some of you that know more about this then me.
I want to run Hero after getting used to it. but after a few hours of running it, it slows down. i have followed every step the ROM devs have said and it still slows down. So i am wondering now, i noticed that Drizzy's ROM has an app and app_s folder in data. I am assuming that app_s is all the apps that go to the sdcard. But even a class 6 card is slower then the internal storage. So maybe moving apks like Rosie and some system apks to internal storage could speed up the way it Hero runs...am i wrong here or going down a path others have already tried?
Click to expand...
Click to collapse
Actually class 6 is faster than internal storage, someone benchmarked the two in another thread that I can't currently find. Other people have tried already, it's probably best to read the first post of each hero thread, and make connections as to what dev's are doing, and what they're not doing. Their latest builds tend to be improvements upon previous builds, so if rosie and all the apk's are on the sdcard, its probably there for a reason whether it be speed or stability.
andonnguyen said:
Actually class 6 is faster than internal storage, someone benchmarked the two in another thread that I can't currently find. Other people have tried already, it's probably best to read the first post of each hero thread, and make connections as to what dev's are doing, and what they're not doing. Their latest builds tend to be improvements upon previous builds, so if rosie and all the apk's are on the sdcard, its probably there for a reason whether it be speed or stability.
Click to expand...
Click to collapse
I am going to research class 6 speeds, I can't see a memory card being faster then internal storage. but I've been wrong in the past...many times heh =)
Yeah the Drizzy ROM is a huge improvement in speed then the others...But there is still quite a bit of lag. I hope they can get Hero running as smooth as JF or Cyanogen's ROMs.
andonnguyen said:
in terminal type:
$free
it will show a section for swap. if it reads all zeros then the swap isn't being used.
Here's an example of my phone:
Click to expand...
Click to collapse
your free shows 97860 total ram, mine with cyanogen 3.9.1 shows 97880 totaly ram, but the phone is supposed to have 192megs of ram. what gives?
Sirus20x6 said:
your free shows 97860 total ram, mine with cyanogen 3.9.1 shows 97880 totaly ram, but the phone is supposed to have 192megs of ram. what gives?
Click to expand...
Click to collapse
Mine in TouchFlo 3D 2.7 shows 98328 for ram. The phone has 192mb of memory but not all of it is user accessible. Not sure why.
Edit:
Just found this on a site:
free will report slightly less memory as being in a computer than the actual total. This is mostly because the kernel (i.e., the core of the operating system) cannot be swapped out (i.e., the kernel always remains in main memory while the computer is in operation), and thus the memory that it occupies can never be freed. There can also be regions of memory that are reserved for other purposes, according to the specific system architecture.
Sirus20x6 said:
your free shows 97860 total ram, mine with cyanogen 3.9.1 shows 97880 totaly ram, but the phone is supposed to have 192megs of ram. what gives?
Click to expand...
Click to collapse
Some of the ram has been allocated for the function of phone and OS running
a 100 meg kernel? my computers kernel is less than 3 megs lol. I imagine that a few megs are saved for a frame buffer, and the os takes up most of the rest but still that's almost exactly half the phones ram. it seems like 100 megs is rather large for a phone OS
I remember windows XP taking half of the basic prebuilt computer's RAM when it first got released. it's not impossible. This IS the first hardcore phone os we've seen like android
So now we have 97,876 kb of memory showing in free. So should the linux swap be 48,938 kb or 48 mb instead of 32? Or because we have less then 128mb of memory should we follow the rule of giving it 1.5 (192 mb) times the amount of memory?
Click to expand...
Click to collapse
In all of the linux systems I have built over the years I have always used 1.5x as the rule... possibly more if I expected that I would upgrade RAM later on. I have always used a swap partition(keeps things nice and clean), but the ability to swap to a file has been around for years. All of the material I've read on the subject maintains that the file is just as fast as a swap partition, though I am willing to bet its lsightly slower due to FS overhead, though this out to be minimal - possibly a bigger deal on a slow embedded system like the G1..
I am going to research class 6 speeds, I can't see a memory card being faster then internal storage. but I've been wrong in the past...many times heh =)
Click to expand...
Click to collapse
Its all in the type of flash chip used and its interface... the interfaces are likely fairly equal(if not exactly the same). The speed of the actual media is entirely dependent on what you spend on it... in all cases for use as swap the speed is SLOW.
So maybe moving apks like Rosie and some system apks to internal storage could speed up the way it Hero runs...am i wrong here or going down a path others have already tried?
Click to expand...
Click to collapse
Sounds reasonable if the internal flash is faster than the flash on the sd card.
What commands did you use to watch the swap partition?
Click to expand...
Click to collapse
You might be interested in the output of the vmstat command(not sure if its available on android) and the file /proc/meminfo (similar to the free command).
You can also watch disk(flash) io in real time with the iostat command....
I did some testing on a random 1GB un-classed sd card I have here and I got 9MB/s writes and 12MB/s reads dding the entire card in Ubuntu.... I used this on the G1 with a swap partition and it lead to lots of force closes and long delays. Flash media will not be an ideal media for a swap file until read/write speeds approach 40MB/s or better and even then will still cause slow operation while swapping(just like a PC).
Based on the many factors with the speed of the platform.... the G1 either needs more actual RAM(find out whats up with the piece we can't get to), or less apps running simultaneously to maintain snappy speed.... and maybe some less heavy apps... 12 MB's of allocated memory is a LOT on a platform with only 96MB available to begin with....
IIRC someone ran benchmarks and found the internal flash mem was almost equivalent to a class 4 card (approx 4 MBps), this particular class 6 card im running right now is almost 8 MBps nearly double the speed of the internal flash memory

[g1] Partitioning The Ram?

I understand that this probably will get moved and placed elsewhere under some long post but I'd like to make an individual thread and catch the eyes of people who wouldn't go through those threads to find this.
Any who can we partition the Ram like we did the sd card for apps?
Why?
To set and limit core apps and fix force closings [possibly] and making space for third party apps to run smoothly.
I don't know if it is possible but I do think it is a beautiful idea.
No, there's no way to accomplish anything like that(at least nothing I've ever heard of and I'm a software engineer)
I'm glad that you feel your idea is more important than everyone elses.
No, you can't partition RAM.
i don't know about android OS but ram drives can be created in linux
ram drive is important for ssd users and is created with tmpfs in fstab
There already are memory usage limits set for different types of applications. You can see this in init.rc. But it's not practical to "partition" the memory or limit the memory used by backgroud apps. As you can see the default policy is actually biased towards background services, etc.
samygent said:
i don't know about android OS but ram drives can be created in linux
ram drive is important for ssd users and is created with tmpfs in fstab
Click to expand...
Click to collapse
Yes, they can be created in Android. That is what compcache uses. But from what I read in the OP, that isn't what he is looking for. Maybe I misunderstood him but it sounded like he wanted to limit certain applications from being able to use too much memory. A RAM drive is available to the OS to manage, right? I don't know of any way to stop a specific application from using a RAM drive.
could he be talking about like how the spl partitions data cache and system?
you mount the ram drive like a normal disk and copy whatever files you want on that partition but sadly everything is lost when you reboot
i would like to try it but i don't want to brick my phone by messing up with my fstab
I think i understand he's question. Would it be possible to use g1 internal memory only for hungry tasks and swap partition for the rest ?
I wish it was but sadly it not possible. I hate it too when some silly task take internal memory space with is way faster then sd swap speed
and now that i think about it , ram drive would'nt really help simply because android applications take very low space on drive
samygent said:
you mount the ram drive like a normal disk and copy whatever files you want on that partition but sadly everything is lost when you reboot
i would like to try it but i don't want to brick my phone by messing up with my fstab
Click to expand...
Click to collapse
I was trying to do it based on some stuff I googled. I can't get it to work. It may not have support for it by default. It could be that Compcache loads what it needs to so that it can create a Ramdisk.
Post the steps that you would use and I will try it. It won't brick my phone, I'll just have to wipe and reload which is no big deal.
not gonna mess with fstab for the moment but you can try this
create a dir somewhere, mkdir -p /system/ram
and then
mount -t tmpfs -o size=5M,mode=0744 tmpfs /system/ram
you now have a 5mb ram drive
copy something on it to test
samygent said:
not gonna mess with fstab for the moment but you can try this
create a dir somewhere, mkdir -p /system/ram
and then
mount -t tmpfs -o size=5M,mode=0744 tmpfs /system/ram
you now have a 5mb ram drive
copy something on it to test
Click to expand...
Click to collapse
It might have to wait until I get off Hero but I will try it.
i'm using hero
funny thing is , i created a 100 mb ram drive, copy something on it and umount it. swap is almost full and 35mb free on internal ram
then tried to start hero browser and it started in about less then 2 secs
samygent said:
i'm using hero
funny thing is , i created a 100 mb ram drive, copy something on it and umount it. swap is almost full and 35mb free on internal ram
then tried to start hero browser and it started in about less then 2 secs
Click to expand...
Click to collapse
Interesting. Try setting it as a swap device. Are you sure it created it from RAM? Is there really 100Mb of RAM free?
yup my hero is a lot faster now
create ram partition, copy big ass file ( 80 mb hero file ) phone is very slow
ram and swap are used up to 100%
umount the ram partition , 50 mb free on internal ram and 50 mb used on swap partition
internal ram goes down to 1-2 mb free space after a few seconds but phone is very damn fast and swap is still filled up to 50 mb
samygent said:
yup my hero is a lot faster now
create ram partition, copy big ass file ( 80 mb hero file ) phone is very slow
ram and swap are used up to 100%
umount the ram partition , 50 mb free on internal ram and 50 mb used on swap partition
internal ram goes down to 1-2 mb free space after a few seconds but phone is very damn fast and swap is still filled up to 50 mb
Click to expand...
Click to collapse
You are basically just forcing the phone to use all swap instead of RAM. Some people set their swapiness to 100, which makes the phone use swap whenver possible. It's strange that swap would perform better than internal RAM. I have some ideas for making Hero run better but I can't get Compcache running on JACxHEROski. Which Hero are you running?
miketaylor00 said:
You are basically just forcing the phone to use all swap instead of RAM. Some people set their swapiness to 100, which makes the phone use swap whenver possible. It's strange that swap would perform better than internal RAM. I have some ideas for making Hero run better but I can't get Compcache running on JACxHEROski. Which Hero are you running?
Click to expand...
Click to collapse
You need to do it via rzstool
And her I thought I was an idiot for not being able to get get compcache running thru the userinit....
I'm sorry to hear that this seams like it can't be done currently but I'm glad I at least created some good conversation amongst everyone.
My whole idea for this was to partition the core apps and limit them/section them to only a certain amount of space to avoid them from force closing since they could have an appropriate amount of dedicated ram to keep them going clean and strong then after all that was taken care of third party apps could have a little space left to run a lot better.
I guess I'm more so just thinking about sectioning off the ram to apps then third party apps.
First off, don't get compcache running through userint.sh edit the user.conf file.

Memhack

There are various mentions of a "memhack" to apply to the Milestone which apparently frees up some RAM. It also apparently can cause problems when flashing a different SBF.
Could someone help me out here by clarifying exactly what the memhack does and what are the circumstances under which it can cause problems?
Looks like this never got an answer, but now I'm seeing that some of the custom nandroid backups here make reference to using memhack. Could someone help me clarify this? I find a lot of Google hits but no explanations except in German... and it doesn't translate very well.
memhack does not free RAM but storage space. It simply moves the cache partition so you get more space for installing apps. As long as you wipe everything when restoring different nandroid backups, I don't think you can really have any issues. Also I don't really think it can affect your ability to flash SBF's. Maybe OTA updates could only be affected as cache gets moved where OTA upgrades are supposed to be downloaded and unpacked.
cmstlist said:
Looks like this never got an answer, but now I'm seeing that some of the custom nandroid backups here make reference to using memhack. Could someone help me clarify this? I find a lot of Google hits but no explanations except in German... and it doesn't translate very well.
Click to expand...
Click to collapse
If you open the script, if I recall correctly, it tries to move the dalvik-cache from the system partition to the cache partition, thus saving you space on the system partition.
i believe the latest version of apps2sd does this automatically ? i've got apps, apps-private and dalvik-cache on my sd card now...
somethingdope said:
i believe the latest version of apps2sd does this automatically ? i've got apps, apps-private and dalvik-cache on my sd card now...
Click to expand...
Click to collapse
Yeah, if you have apps2sd you don't need to apply memhack. In fact, it might mess up your device since the symbolic links for dalvik-cache should be pointing to the SD card, not the cache partition.
Thanks for clarifying. I'm starting to run low on app space on my Milestone but I'm not keen to use the apps2sd hack as I've heard it can cause all sorts of trouble. Not impressed that official Froyo is so far away.
cmstlist said:
Thanks for clarifying. I'm starting to run low on app space on my Milestone but I'm not keen to use the apps2sd hack as I've heard it can cause all sorts of trouble. Not impressed that official Froyo is so far away.
Click to expand...
Click to collapse
It's really not that hard once you understand how all of these things work. "Memhack" is too 'scary' a name for a simple thing.
dsixda said:
Yeah, if you have apps2sd you don't need to apply memhack. In fact, it might mess up your device since the symbolic links for dalvik-cache should be pointing to the SD card, not the cache partition.
Click to expand...
Click to collapse
this is not correct.. its actually a worst case scenario, and /dalvik-cache should only be on sdcard, when you're a apps hungry person that cannot work with 100MB free for the purpose..
current disadvantages on milestone for using dalvik on sdcard;
- unstable and slow ext2 kernel module..
- lacks direct io support
- slows phone if sdcard is class2 only.
- no support for wipe of /dalvik-cache folders with any current recovery.
- not a solution if no sdcard is present or paritioned correctly.
(suddenly /data is full?)
Advantage over sdcard pointers for dalvik are;
- faster seek times
- faster loading
- easier cleanup if required when switching roms
- still works even without sdcard inserted.
but if people dont care or know the consequences of their changes, they just accept.
Dexter_nlb said:
this is not correct.. its actually a worst case scenario, and /dalvik-cache should only be on sdcard, when you're a apps hungry person that cannot work with 100MB free for the purpose..
current disadvantages on milestone for using dalvik on sdcard;
- unstable and slow ext2 kernel module..
- lacks direct io support
- slows phone if sdcard is class2 only.
- no support for wipe of /dalvik-cache folders with any current recovery.
- not a solution if no sdcard is present or paritioned correctly.
(suddenly /data is full?)
Advantage over sdcard pointers for dalvik are;
- faster seek times
- faster loading
- easier cleanup if required when switching roms
- still works even without sdcard inserted.
but if people dont care or know the consequences of their changes, they just accept.
Click to expand...
Click to collapse
I actually didn't experience any performance gain or loss when moving my dalvik cache to my Class 6 card. I also have no need to remove my SD card. Of course most people should be aware that moving anything to SD requires at least a Class 6 (usually) if you want any kind of performance.
dsixda said:
I actually didn't experience any performance gain or loss when moving my dalvik cache to my Class 6 card. I also have no need to remove my SD card. Of course most people should be aware that moving anything to SD requires at least a Class 6 (usually) if you want any kind of performance.
Click to expand...
Click to collapse
Classes don't mean much for SD cards. They do to an extent, but in the end you really need to rely on benchmarks.
Class simply means minimum speed. A Class 6 card could run as slow as 6 MB/sec or go as fast as 20 MB/sec. Not sure.
I have a Sandisk Class 4 8gb microSDHC card. I saw the 16gb benched at 15MB/sec or so. I can hit 18-19MB/sec on mine.
This is considerably faster than the 16gb Class 2 that my Milestone shipped with. It's also considerably faster than the 16gb Class 6 Transcend I wanted to get. But remember my Class 4 promises 4 MB/sec transfers. These speed tests I've done are pretty darn fast.
Another example is my Class 6 Transcend 16gb SDHC (not micro) for my Canon Rebel camera. I benched it around 8.9 MB/sec. That's within Class 6 limits, but presumably my Class 4 8gb microSDHC Sandisk mounted on an adapter should do even better fine if I was able to bench it at 18 MB/sec on my computer....
So it's hard to say. If a Class 2 is really Class 2 at its minimum 2mb/sec, that's a pretty darn slow card.
Ok well I was getting close to that 20 MB "low memory" threshold so I memhacked using GOT OpenRecovery 1.04a. Nandroid backup first of course. Available space has skyrocketed to 91 MB! Sweet.

RyanZa's one click lag fix

Hi,
I was browsing the dev forum for the lag fix and I was wondering if anyone had any first hand experience using it on the Epic? I searched and didn't find anything substantial in this forum.
Thanks,
Tonythetigger said:
Hi,
I was browsing the dev forum for the lag fix and I was wondering if anyone had any first hand experience using it on the Epic? I searched and didn't find anything substantial in this forum.
Thanks,
Click to expand...
Click to collapse
It's not needed. Have you seen your Epic lag? If so, return it.
Well, it lags a little when I try to open barcode reader or the camera? I thought there was discussion on how the Epic would still receive a benefit from the lagfix..
Actually you can pretty easily make it lag. Take two pictures at full res and then go through gallery and attah them to gmail. Send. If you are not on wifi the phone litterally is paralyzed until its finished.
Those chose pooly on the formating
So has anyone used the lagfix?
I believe or partitions are different. That would most likely brick your device if used. I'm fqairly certain we could do the same for our devices but that's going to take time. Working recovery > that atm.
Aridon said:
Actually you can pretty easily make it lag. Take two pictures at full res and then go through gallery and attah them to gmail. Send. If you are not on wifi the phone litterally is paralyzed until its finished.
Those chose pooly on the formating
Click to expand...
Click to collapse
Well thats not fix with a LagFix. Thats a bug. It happens attaching it to anything. MMS, Gmail, Email, Facebook. Its a known bug.
Well my quadrant benchmark is 1k, shouldn't it be capable of going up to 2k?
I believe the lagfix will actually work, and may even help. I don't have an epic, so I can't test it at all.
Anyway, the I9000 has 8gb or 16gb internal memory. 2gb of that is dedicated to /data (data is where all your apps and their data go).
The epic has 2gb? 1gb? -- some amount of fast internal memory dedicated to /data.
Both the I9000 and your epic use the RFS filesystem, which appears to be very poor.
What the OCLF apk does is make a loopback EXT2 partition in your RFS filesystem, and then uses symlinks to make android put the apps/data inside the EXT2 partition. This should work fine on your epic, especially if you have 2gb of program memory! If you have less than 1gb it may be a problem though.
Feel free to try it out if you have rooted your device! (The I9000 root won't work on the Epic)
RyanZA said:
I believe the lagfix will actually work, and may even help. I don't have an epic, so I can't test it at all.
Anyway, the I9000 has 8gb or 16gb internal memory. 2gb of that is dedicated to /data (data is where all your apps and their data go).
The epic has 2gb? 1gb? -- some amount of fast internal memory dedicated to /data.
Both the I9000 and your epic use the RFS filesystem, which appears to be very poor.
What the OCLF apk does is make a loopback EXT2 partition in your RFS filesystem, and then uses symlinks to make android put the apps/data inside the EXT2 partition. This should work fine on your epic, especially if you have 2gb of program memory! If you have less than 1gb it may be a problem though.
Feel free to try it out if you have rooted your device! (The I9000 root won't work on the Epic)
Click to expand...
Click to collapse
Its 1Gb. But its not completely empty.
Also, I'm willing to test it. Do you have a link for the download?
Well the Epic has 512 ram and 512 rom, Froyo is supposed to allow the phone to use the SD card as install room for apps.
Would the lagfix run there?
Here is the link to the app: http://forum.xda-developers.com/showthread.php?t=760571
Fixter said:
Its 1Gb. But its not completely empty.
Also, I'm willing to test it. Do you have a link for the download?
Click to expand...
Click to collapse
It's on the market.
http://www.appbrain.com/app/com.rc.QuickFixLagFix
1GB... and yeah its obviously not empty, it has all your stuff in it!
Anyway with 1GB is might be a bit tight, as that would leave only 500mb or so for apps.
Make a backup before you test it though, since I think you're the first person to test it on the Epic. It should refuse to run if there is anything wrong though.
So if the phone can use the SD card for /data would the fix have more space there? Or would we just get more space to install and run apps
RyanZA said:
It's on the market.
http://www.appbrain.com/app/com.rc.QuickFixLagFix
1GB... and yeah its obviously not empty, it has all your stuff in it!
Anyway with 1GB is might be a bit tight, as that would leave only 500mb or so for apps.
Make a backup before you test it though, since I think you're the first person to test it on the Epic. It should refuse to run if there is anything wrong though.
Click to expand...
Click to collapse
It says Unavailable.
Tonythetigger said:
Well the Epic has 512 ram and 512 rom, Froyo is supposed to allow the phone to use the SD card as install room for apps.
Would the lagfix run there?
Here is the link to the app: http://forum.xda-developers.com/showthread.php?t=760571
Click to expand...
Click to collapse
512MB is going to be too little.
You can actually get around this with a fast SD card though! If you know how to use gparted, you can make a 2GB or so EXT2/3 partition on your SD card, and then copy your data across to that, and use symlinks to point Android there. With the Epics fast NAND though, this shouldn't be necessary for speed - but it might be really nice for you guys if you want to install a lot of apps!
EDIT: You can follow mimocan's tutorial here: http://forum.xda-developers.com/showthread.php?t=724251
Just don't use EXT4 since your kernel won't support it. There is a way to dynamically load the EXT4 kernel module though, if anybody is interested.
RyanZA said:
512MB is going to be too little.
You can actually get around this with a fast SD card though! If you know how to use gparted, you can make a 2GB or so EXT2/3 partition on your SD card, and then copy your data across to that, and use symlinks to point Android there. With the Epics fast NAND though, this shouldn't be necessary for speed - but it might be really nice for you guys if you want to install a lot of apps!
Click to expand...
Click to collapse
Thats weird.. On the Samsung Specsheet is says 1Gb. I saw it not 30 minutes ago.
EDIT: User Memory 1GB (not all is usable for customer use/downloads)
DAMN IT! I'm sure Touchwiz is using the other 500Mb.
Here's a link to the dev page, you can download the app directly from there: http://forum.xda-developers.com/showthread.php?t=760571
lag fix?
SDcard-using lag fix is obviously unnecessary for Epic 4G.
The reason why Epic has a small NAND chip is that it uses a different type of NAND, called "OneNAND." OneNAND is much much faster than normal NAND or moviNAND (which other Galaxy S's use).
This is why Epic users don't experience "lag" which exists in Vibrant or Captivate.
But we can still make Epic faster, by getting rid of Samsung's rfs file system (which obviously makes Vibrant/Captivate slower) and mounting ext3/4 or other faster file system.
Then we need:
1) patching kernel or adding module to support ext3/4/nilfs2/yaffs2/ubifs/btrfs/etc/whatever we want.
(ext2 is supported by the stock kernel I think. However, unlike SD card and moviNAND which have own hardware wear-leveling algorithms in their controllers, OneNAND does not has it, so I'm not sure if ext2 (which does not support journaling/log) is okay to use.)
2) backing up the partitions which we want to change the file system from rfs
(such as: /data/data, /data/app, /data/dalvik-cache, etc, whatever)
and finally formatting it to what we want, and mount it.
3) kernel or script that automatically mounts as the file system we want.
4) a genius who can do this. (It is obviously not me.)
This is done for Captivate in XDA forum, and also for Galaxy S M110S in a Korean forum.
chocoberry said:
SDcard-using lag fix is obviously unnecessary for Epic 4G.
The reason why Epic has a small NAND chip is that it uses a different type of NAND, called "OneNAND." OneNAND is much much faster than normal NAND or moviNAND (which other Galaxy S's use).
This is why Epic users don't experience "lag" which exists in Vibrant or Captivate.
But we can still make Epic faster, by getting rid of Samsung's rfs file system (which obviously makes Vibrant/Captivate slower) and mounting ext3/4 or other faster file system.
Then we need:
1) patching kernel or adding module to support ext3/4/nilfs2/yaffs2/ubifs/btrfs/etc/whatever we want.
(ext2 is supported by the stock kernel I think. However, unlike SD card and moviNAND which have own hardware wear-leveling algorithms in their controllers, OneNAND does not has it, so I'm not sure if ext2 (which does not support journaling/log) is okay to use.)
2) backing up the partitions which we want to change the file system from rfs
(such as: /data/data, /data/app, /data/dalvik-cache, etc, whatever)
and finally formatting it to what we want, and mount it.
3) kernel or script that automatically mounts as the file system we want.
4) a genius who can do this. (It is obviously not me.)
This is done for Captivate in XDA forum, and also for Galaxy S M110S in a Korean forum.
Click to expand...
Click to collapse
Thank you for the explanation. Now lets wait for the genius.

[Q] About swap space, this device and cyanogenmod

This may be a general question for all android devices or not but I was curious about adding swap space to this device. It has 1 gig of ram and many may consider that to be enough, and it might be. I have cyanogenmod 10.2 installed and tried to enable zram, 10% seems to be the best setting as anthing higher caused a game to pop up a notice saying something about low memory and defaulting to lower values. When I checked to see if zram was used however it turns out it was, about 25mb - 34mb after booting. The issue with zram is when multitasking with lecturenotes and moonreader, The tablet would reboot and my notebook that was open in lecturenotes would be missing notes I took or the settings would be greatly messed up, or both. This was with 10%.
I am thinking since it was used, it might be helpful to have an sd card for this reason, to aid in multitasking. This is important to me because I run several apps at once (I wish cyanogenmod had multi windows, and google wouldn't threaten over it). So the question is will there be a benifit to buying an sd card on ebay (class 10 of course) and using it as swap space. It seems this tablet might be on the cusp of the memory being enough. Also I am thinking this might help to future proof it a bit when updating to newer releases of gyanogenmod. The sd card I was thinking of is 4 gigs and may plan on having 1gb swap space (this tablet is for school and other work). The tablet has 32gb storage and that is more than enough for me (I am only using 3gb of space) so I wont need to add anymore storage.
I should also add that when multitasking without zram enabled, the tablet reboots less but still has done it, and so far nothing has been lost in my notebooks. I am thinking that the memory of 1gb is starting to reach its limit, with no apps running I am consuming about 600mbs of it.
vanquishedangel said:
This may be a general question for all android devices or not but I was curious about adding swap space to this device. It has 1 gig of ram and many may consider that to be enough, and it might be. I have cyanogenmod 10.2 installed and tried to enable zram, 10% seems to be the best setting as anthing higher caused a game to pop up a notice saying something about low memory and defaulting to lower values. When I checked to see if zram was used however it turns out it was, about 25mb - 34mb after booting. The issue with zram is when multitasking with lecturenotes and moonreader, The tablet would reboot and my notebook that was open in lecturenotes would be missing notes I took or the settings would be greatly messed up, or both. This was with 10%.
I am thinking since it was used, it might be helpful to have an sd card for this reason, to aid in multitasking. This is important to me because I run several apps at once (I wish cyanogenmod had multi windows, and google wouldn't threaten over it). So the question is will there be a benifit to buying an sd card on ebay (class 10 of course) and using it as swap space. It seems this tablet might be on the cusp of the memory being enough. Also I am thinking this might help to future proof it a bit when updating to newer releases of gyanogenmod. The sd card I was thinking of is 4 gigs and may plan on having 1gb swap space (this tablet is for school and other work). The tablet has 32gb storage and that is more than enough for me (I am only using 3gb of space) so I wont need to add anymore storage.
I should also add that when multitasking without zram enabled, the tablet reboots less but still has done it, and so far nothing has been lost in my notebooks. I am thinking that the memory of 1gb is starting to reach its limit, with no apps running I am consuming about 600mbs of it.
Click to expand...
Click to collapse
Well in my own personal testing i could not see any benefit while extracting 700mb archives under android with 4gb swap space on a 40mbs microsd card, while under full linux desktop with a same workload, swap differently helps keep the system smooth under heavy io load. The conclusion i drew was the android platform deals to memory management differently than the typical desktop os, due to slower emmc chips used as a boot disk for the majority of android devices using this slow, already bottlenecked memory as swap space doesn't make sense (not to mention the use of 2gb swap space on a limited 16gb storage etc), so android runs almost completely in ram, with stricter memory management and allocation allows android to run fine without swap space, although because of this, androids memory management makes little uses of available swap space
JoinTheRealms said:
Well in my own personal testing i could not see any benefit while extracting 700mb archives under android with 4gb swap space on a 40mbs microsd card, while under full linux desktop with a same workload, swap differently helps keep the system smooth under heavy io load.
Click to expand...
Click to collapse
I've been running my desktop without swap for the last 10 years, and as long as you have enough RAM for all your running programs, there will be no problem at all.
Extracting an archive is a mostly sequential operation (single read stream, single write stream), so it also doesn't benefit from caching, which could use the memory that is freed by swapping.
_that said:
I've been running my desktop without swap for the last 10 years, and as long as you have enough RAM for all your running programs, there will be no problem at all.
Extracting an archive is a mostly sequential operation (single read stream, single write stream), so it also doesn't benefit from caching, which could use the memory that is freed by swapping.
Click to expand...
Click to collapse
Ahh that makes sense. I wasnt sure if swap had an effect directly on the extraction, but seem keeped the rest system more stable/ smooth duing the process in the case of GNU/Linux, with swap off similar operations such as installing packages would more oftern lock the tablet up. Might be a placebo though
I also dont set swap on my Linux desktop, as it has plenty of ram but the benitfit of swap space is somewhat more noticable due to the lack of ram on the tf700.
JoinTheRealms said:
I also dont set swap on my Linux desktop, as it has plenty of ram but the benitfit of swap space is somewhat more noticable due to the lack of ram on the tf700.
Click to expand...
Click to collapse
I just want to share my user experiences on the swap space... It does seem to improve the tf700 with swap space due to the lack of RAM (1GB)..
Thanks for all the useful posts
Thanks for all the posts, I have my sd card on the way. I will post my experience when I get my sd card but I am sure it is safe to say there will be a benefit. I use linux to at home and have 8 gigs of ram on that computer, I lessen the swap after install to about 512mb because 8 gigs is more then enough. I leave some however just incase of any issues like ram going bad. On another computer in the house that has limited ram (1.5 gigs) I have enabled zram (384 mb) and added two old flash cards (1 gig each) to a pci raid card and those were converted to swap. I then altered the fstab to reflect the order of priority I wanted them used in. The reason is that when the swap is used from the hard drive, and the hard drive is being written to, can cause a slow down. So with the 2 flash cards at 1 gig each (the swap seen as 2 gigs) it seemed to speed it up. I just posted that because of the nix users and it seemed like a good plan to run it that way.
Ok, got the sd card
So I recieved the sd card today and applied the swap space to it using root swapper (max setting is 256mb, I figured i can find a way to increase it later if I need to). The defaut location in many of the swap applications will not work on this device however, the sd card mounts at /storage/sdcard1 in my case. So it has to be entered manually (might just be cyanogenmod). Also the device was picky when insalling the card, it would only say blank sd card or cannot read filesystem. I had to install the card in the dock, format it from cwm recovery, (vfat if I remember correct, ext2 and ntfs had issues, avoided ext3 and ext4 cause journaling will cause more wear and tear).
The sd card is a scandisk ultra sdhc uhs-1 8 gigs. From my research that is the fastest this tab can handle. I also use optimising programs like greenify (epic save everything app), pimp my rom (almost every tweak applied), and some pretty efficient tweaks in the settings as well. I also have HALO))) installed and working (epic multiwindow app that works with native programs and almost any rom).
The resuts:
I tested it many ways, I rebooted to see use (none was used because swap starts after boot), I opened apps normally (browsers and things), and it showed 9kb's was used. I then put it to the tests, I open four windows in halo, these were youtube, moonreader pro with a pdf ebook, lecturenotes (awsome note and handwriting app with tons of functions), and Supernote pro (not the best note app). Constantly switched between the apps and messed with settings with them open. The max of swap used was around 10mb(keeping in mind that when I switch windows the app(s) I leave get paused making it hard to tell actual usage because I had to swith the terminal and type "free". I then ran antutu bechmark and gpubench (my tab stills score pretty well) and got a little higher swap usage but not much.
As for the feel of it, it seemed to help when opening many windows in halo, this is the primary reason for my doing this. As for other more normal uses I really didnt see too much of a difference, I did test games however and they did seem a little better (could be placebo) but I am not really sure why they would except android cached other apps to free memory. Reopening apps seemed faster. Also because of apps like greenify my memory usage is decreased so I am sure typically swap would have seen more use.
The conclusion is that at this point I really didn't notice much of a boost for any normal use, but I will definately keep the swap space on due to the boost when using halo and not to mention that I will be updating to android 4.4 soon and it might need more memory. Swap at this point seems more like a pre emptive strike, but it does help with multitasking.
about swap
://androidforums.com/boost-mobile-warp-all-things-root/610449-ram-swapping-without-swapper2.html I actually followed a guide on android central and redid the swap file to 1 gig to swap instead of using a program, this worked better. (add http in front), when i disabled swap it was noticeable that there was a boost. then reenabled it this method.

Categories

Resources