OESF Portables Forum
General Forums => General Discussion => Topic started by: ShiroiKuma on November 08, 2004, 04:20:50 pm
-
Hi:
I thought the more free RAM you have on the Z the more free memory the programs have to run.
However while when I do df I get /dev/mtdblock3 96256 14148 82108 15% /home
this is the line that refers to free RAM right?
But then when I do free I getMem: total 62112 used 60660 free 1452
Why? Why isn't it 80Meg?
I thought installing progs to SD means there's gonna be more free memory to run them. So why do I keep running out of mem, when there's 80 Meg free on internal flash?
-
df is reporting the amount of free Internal Flash and External Storage (CF, SD, USB storage, etc.). This is not the same as Physical memory. Think of the 'df -h' output as how much free disk space you have where as 'free' will tell you how much free RAM memory you have available to run applications.
The Zaurus is not like Palm OS which executes code in place. The Z functions more like a traditional OS which reads data from storage media into memory and then executes the code.
-
So does it make sense to install progs to SD, like I have done so that you have more mem to run progs. From what you sap I'd think I shouldn't even bother and just install them to internal flash, right?
-
No, installing to SD is a good idea since flash memory only has so many writes before it fails. It is better to have your SD card with bad sectors than your internal flash, which is not easily replaced. I also recommend putting database, swap files, etc. onto external storage for the same reason. On my Z I have moved /home/tmp to my SD card to reduce writes.
-
On the SL-CXXX, SL-5600, and SL-6000, installing to SD definitely does *not* give you more memory to run programs. So if you have the space available, installing programs to internal flash instead of SD is a perfectly reasonable thing to do. Any free internal flash is, in essence, wasted since it can't be used for anything except storage. The wear limit in internal flash is on the order of 100K cycles per sector so it's *highly* unlikely that you will ever wear out internal flash sectors by just installing programs. Swap files, databases, frequently changed documents, etc. are a different story and keeping them on a memory card is a pretty good idea.
Now, one good reason to install stuff to SD and preserve internal flash space (assuming you're running a Sharp or Sharp-compatible ROM) is that there are some programs that will *only* install to internal flash memory. Typically, server type applications (apache, mysql, etc.) and libraries need to be in internal memory. If internal memory is filled with stuff that would work just as well on CF or SD and you run across an app that must be installed to internal, you're out of luck.
My rule of thumb is that if an app is a fundamental part of how I typically use the Zaurus it goes to internal flash. If it's just a convenience or nice to have, it goes to SD (assuming it will install there without issues).
-
But then when I do free I getMem: total 62112 used 60660 free 1452
Just to complete the other responses, it is perfectly normal to have your RAM allmust full. A reasonnable OS uses the RAM to keep the latest data you have read from the hard drive (or some other kind of slow acces storage, ie the internal flash or a SD/CF card for the Zaurus) in case you need them a second time. This speeds up the thing, and of course if some app needs more RAM this cache is freed.
-
Do you have a lot of programs on fastload? Disabling fasload would help your memory.