whats is /dev used for? - G1 Android Development

I noticed that /dev partition doesnt seem to get used often. Was thinking about having the swap file sit there. It looks like the partition gets cleared out after a reboot which is fine by me. would gladly sacrifice some extra bootup time for faster swap file.

/dev is a pseudo filesystem containing handles for your hardware devices
do not touch it

/dev is actually mounted in RAM, so putting a swap file there doesn't make much sense.

I have a question:
If one does Apps2SD, you get a free space of around 75 MB on the data partition, right?
Can't this space be used for a swapfile instead of using the SD card? The internal memory should be faster than any SD card. Please correct me if I'm wrong.

djvw said:
I have a question:
If one does Apps2SD, you get a free space of around 75 MB on the data partition, right?
Can't this space be used for a swapfile instead of using the SD card? The internal memory should be faster than any SD card. Please correct me if I'm wrong.
Click to expand...
Click to collapse
yes but you will wear this memory out...then your phone will be useless... better to wear out a sd than wear out memory you cant replace

Related

getting swapfile working on /data partition

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

[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.

Internal Storage 2GB? Why Is that?

So I managed to get a ROM going on my tab that came today, and all is pretty good so far. One question tho; I went to my settings --> SD card usage or whatever its called and my internal memory is showing 1.79GB total space.
My SD card is 16GB and that's showing up fine as 14 or whatever FREE, since I partitioned at 2048/0.
I don't get why the internal storage is 1.79. Shoudn't it be 16GB or whatever since that's how much this tablet has? I'm confused.
Thanks!
I may be wrong on this (Developers, please correct me if I am wrong) but I think the 2GB is reserved for the Android system and the remaining space is what you can use for apps, etc.
stuaross said:
I may be wrong on this (Developers, please correct me if I am wrong) but I think the 2GB is reserved for the Android system and the remaining space is what you can use for apps, etc.
Click to expand...
Click to collapse
if thats the case, why won't it show the remaining 14G or whatever hmmm
The 16gig is divided as 2gig for apps and 14gig for storage (/sdcard). After format and overhead you get what you see.
Sent from my Viewsonic 10" GTab...CM7 style...
So how do i mount my internal? Im only able to mount my microsd card..
Actually I take that back. I can only mount my internal storage to my computer but not my microsd card. I have no idea how to do that...
That's normal behavior for the gtablet. There is no built in method for mounting the external SD to your computer.

Why we should divide sd card two part(fat32 and ext 4)?

I will install cyanogenmod[02.14.2012]. Before installing that, must i divide the sdcard two part(ext4 and fat32)?
if i don't divide sd card ,can i install app to sd card(can i experience any problem app moving sd card)?
Well, you hould divide sd card for three parts, not two.
fat32, ext4, swap.
Why ? Because phone with swap works much more faster.
how many megabytes are enough for swap and ext4?
and can we divide using MiniTool Partition Wizard Home Edition 7.0 ?
oddo1907 said:
how many megabytes are enough for swap and ext4?
Click to expand...
Click to collapse
There is a rule that swap must be two times the size of your physical memory (RAM), so you should set it to 512MB of swap. That's how you have 768MB of virtual memory. The tricky party is that with swap your phone becomes able to run heavier apps which requires more RAM but also since you use SD card instead of ram your phone becomes slower when it's in use of swap.
As for the ext4 partition, I usually set it to ~400MB. But I never manage to even come closer to use all of those 400MB. 50+ apps are arouond 200MB so decision is yours.
Cheers!
additon, how can divide sd card? i used minitool partition home edition.will be this cause any problem?
oddo1907 said:
additon, how can divide sd card? i used minitool partition home edition.will be this cause any problem?
Click to expand...
Click to collapse
No problem but it's better to use a memory card reader than to make it with phone in usb.
I tried with phone in usb and I had to pull battery and to retry.
eSu.Matix said:
There is a rule that swap must be two times the size of your physical memory (RAM), so you should set it to 512MB of swap. That's how you have 768MB of virtual memory. The tricky party is that with swap your phone becomes able to run heavier apps which requires more RAM but also since you use SD card instead of ram your phone becomes slower when it's in use of swap.
As for the ext4 partition, I usually set it to ~400MB. But I never manage to even come closer to use all of those 400MB. 50+ apps are arouond 200MB so decision is yours.
Cheers!
Click to expand...
Click to collapse
With all new ROMs (CM7 by fjf, Cronos Ginger 1.7, etc) coming in to our phone, are all of them support this swap partition? Thanks.

Internal memory related

Can any developer make use of the scripts used here http://forum.xda-developers.com/showthread.php?t=1281964 and make a detailed tutorial to increase the internal memory without having to use apps like link2sd
Some suggestions:
making the 2nd partion ext3 instead of ext2 to be able to handle more space
explaining the part of the htcfs
Cheers
Well, it's something quite similar.. and it's easier to use Link2SD actually. You can set the ext4 partition on the SD card to anything and just move everything.
Also, mounting /data/ to SD card will cause some lag; you'll need a higher SD card class. IMHO it's not worth the trouble - I have around 50 apps installed, including Sygic Aura (which is about 18 MB) and moved them all with Link2SD. Internal free space is 40 MB right now.

Categories

Resources