View Single Post
Posts: 5 | Thanked: 0 times | Joined on Jan 2006
#11
Originally Posted by RogerS
What size should I make the second partition?

I will be putting a swap file on there. I'd like to be able to put a lot of unnecessary applications on my 770 -- well, you know what I mean: lots of applications that I want to check out but won't use regularly, and apps I want as insurance (so that I can work on some file if I ever have to, for my job and such -- something like the gnumeric spreadsheet app). What size do you think should be big enough, without being too big and squandering space?
There are only quesses that can be offerred. First you make a guess based on certain "known truths" and then you tune. I've often heard Oracle say that swap space should be two times the amount of physical memory. Your swap space is known as virtual memory. Physical memory--RAM in this case--is what your programs load into and run on any computer. Swap is what is used when you "over commit the use of your physical memory". When you load in more programs than the physical RAM memory on the computer, then the operating system puts programs that are idle in the swap area on disk. For regular hard drives the mechanical portions of the drive are much slower than the swap that you will be creating i.e. you will be using solidstate memory for you swap!

Ok so this site says that the 770 has 64MB of RAM inuxdevices.com/articles/AT5858395674.html . Based on the Oracle guess then you'd want 128MB swap space. That would still leave you with 64mg of flash ram and 812MB on your MMC card. Now when you say you are going to install lot's of applications that is not the same as using memory or swap. The installation is what you'd put in your 812MB of space. To give you a perspective the largest app that I have installed so far is 2,408,576 while rsync is the smallest at 241,548. If you run xterm, then it will consume 2.4MB of memory. I think you'd have more than enough for both areas, if you use the 128/812 configuration. But remember Oracle's recommendation is for heavy hitting databases. 128 feels to big here.

You are really on a single user system and not on a multi-user system. I've noticed that I cannot seem to run two copies of the same application. If I run marbles, then hit the launcher for the second copy, the 770 switches me back to the first running copy in memory. If I go to the xterm command and run free I see
Mem total 61828; Mem used 58428; Mem free 3400; and Mem shared 0. It is interesting that this version of the free command does not have the cached count. Compare these number with two other linux systems
[drkludge@bagheera ~]$ free
total used free shared buffers cached
Mem: 514744 498552 16192 0 18036 199612
-/+ buffers/cache: 280904 233840
Swap: 2064376 0 2064376

This machine has 512MB used as a workstation. It has a 2gig swap partition and note that under the used column zero is used.

[drkludge@baloonew ~]$ free
total used free shared buffers cached
Mem: 2054724 2027660 27064 0 57600 1753672
-/+ buffers/cache: 216388 1838336
Swap: 2064376 696 2063680
[drkludge@baloonew ~]$ uptime
00:58:36 up 77 days, 10:50, 1 user, load average: 0.19, 0.06, 0.01
(I hope the formatting stays alined or it will be confusing to try and read these numbers.)
Here's a file server that has been up for 77 days. It has 2gig of memory and a 2gig swap partition. Only 696MB of the swap partition is being used. That's a terrible waste of a 2300+MHZ athlon 64. A 500MHZ AMDK62 junker would serve NFS and SAMBA just as good. The only hope for this configuration is that when a request for user data is made, then it will come out of the used, shared, buffers, or cached memory pools. The buffers/cache line tells you how fast the linux kernel can rearrange memory from the buffers and cached pools. You really hope that you don't take from Swap because it is on disk in this case. Note that this machine has a swap partition the same size as the physical RAM and not much of it is used.

Now the small memory foot print of the 770 is where a swap partition would really shine. I have 3400 free right now. If I fire up vim or gaim, then the O/S will really have to figure out where to put stuff. I think I saw where thoughtfix had success with just 16MB for a swap partition. An interesting project would be to try various sizes and record the results: 16MB, 32MB, 64MB, 96MB, and 128MB. The down side is that you'd have to reformat and completely reinstall your apps/data. You can allocate space for 128MB of swap in a partition but build it for only 16MB to start. The rest would go to your user data. If you find at some point, say, 32MB is the magic number, then you want to reformat the MMC card for 32MB swap/the rest user data.

For some reason I was amazed to find the free command on the 770. I found it more amazing to see the top command. The top command allows you to see what is going on in your 770 almost realtime. Hit the fullscreen button on the 770 before you run top in the xterm window. The memory numbers at the very top of the screen will be cut off if you don't. It's impossible to scroll up fast enough to see 'em.
Top shows
Mem used 54860K; Mem free 6968K; Mem shared 0K; Mem buffers 160K; and Mem cached 20840K.
If I alt tab with the keyboard to see marbles, then I find that the 770 has paused the game. I can only see small changes in the top numbers when I create another xterm _tab_ with Properties button>file>newtab while in xterm full screen mode.

Finally, just as I have noticed that GUI apps are inactive when you switch to another application, I wonder what the impact to memory and swap is when the machine powers down the display?

Hmmm...16MB, 32MB, 48MB, or 64MB may be good starter numbers. With 1Gig of MMC, I'd save most of that for music, videos, pdf books to read, applications, or application data files, etc. As you can see much of this is a guess. You'd have to take time to perform long term trend analysis. So go with 64MB and don't worry about it! As with all caching or swaping schemes you need memory to burn and you have it. The moment you shutdown the device, the caching and swaping have to build up again on the next boot.

I hope this helps. Perhaps I need to clean this up and put it on the wiki too as "page two" of the swap file article--bad pun intended.

Greg