Author Topic: Should I Make A Swap File?  (Read 3176 times)

BeKind

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • http://www.seizurerobots.com
Should I Make A Swap File?
« on: December 15, 2004, 05:46:11 am »
Hello!

I have a 5500 with just one card (SD) that I'm going to pretty much leave in there all the time.

It is 512 MB Kingston which I just barely got, and stuck in and ran mkfs.ext2 on it.

I was reading on the forum and I found that some people with this size card like to put a 64 MB swap file on there, but they all seem to be running big stuff like compilers or debian+xwindows.

I am more concerned about something like Konqueror.  I had Konqueror running on the SD card and it segfaults when I navigate to certain places, like the forums on this site.

So either I am hoping that maybe a swap file could make it more stable (maybe wishful thinking), or at least be a useful step along the path to set up the Z to run some other browser. (I'm trying to plan out my approach now before I get too far into it.)

I am wondering if it would improve the performance of a web browser or if it would be neutral or actually hinder it to have a swap file mounted?  When SHOULD the Z have a swap file?

Any opinions?

bluedevils

  • Hero Member
  • *****
  • Posts: 1284
    • View Profile
    • http://
Should I Make A Swap File?
« Reply #1 on: December 15, 2004, 08:14:26 am »
AFAIB a swap file can only help and you have nothing to lose.  I believe memory gets used first and then swap.  So the etremes are  swap never getting used or the swap is needing it all the time.  It's wear and tear on the SD, but from my experiences with the sharp rom it is well worth it.
« Last Edit: December 15, 2004, 08:14:59 am by bluedevils »
I'm now an iphone user and use my zaurii as serial terminals, perl and shell scripting and when I need 640x480 screens

sl-c3100/pda cacko 1.23 | sl-6000l/needs battery | sl-c760/server pdaxrom rc12 | Former sl-5500/tkcrom owner (sister's birthday gift)

adf

  • Hero Member
  • *****
  • Posts: 2807
    • View Profile
    • http://
Should I Make A Swap File?
« Reply #2 on: December 15, 2004, 11:30:50 am »
Mine as well... I can usually get by without swap on OZ, but with sharp (and theses days I do pocket workstation and xqt too) with sharprom i need at least 32m of swap to be comfy.... Of course I'm on a 5600 which has some problematic memory limits anyway...
adf
**3100 Zubuntu Jaunty,(working on Cacko dualboot), 16G A-Data internal CF, 4G SD, Ambicom WL-1100C Cf, linksys usb ethernet,  BelkinF8T020 BT card, Belkin F8U1500-E Ir kbd, mini targus usb mouse, rechargeble AC/DC powered USB hub, psp cables and battery extenders.

**6000l  Tetsuized Sharprom, installed on internal flash only 1G sd, 2G cf

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Should I Make A Swap File?
« Reply #3 on: May 28, 2005, 05:56:22 pm »
(save a e-tree, revive an old thread )

I'm currently creating two swap files, one 32mb the other 16mb for testing (& to get gxine working on my Z, see this thread)

I noticed that when I flashed the latest OZ-GPE 3.5.3, I had about 24mb free under /home, so there'd be room for the 16mb swap file there. Would it make any performance differences me putting the swap under /home or putting it on an ext2 sd card (the only option for the 32mb file)? I remember reading something in a past post about the sd/mmc driver that the Z uses tends to slow things down, but I can't remember or find the details.

Quote
Of course I'm on a 5600 which has some problematic memory limits anyway...[div align=\"right\"][a href=\"index.php?act=findpost&pid=57472\"][{POST_SNAPBACK}][/a][/div]
Just curious what you meant by this? Is there something I should know about my Z?

thks
GROG!

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Should I Make A Swap File?
« Reply #4 on: May 28, 2005, 07:32:16 pm »
Quote
I noticed that when I flashed the latest OZ-GPE 3.5.3, I had about 24mb free under /home, so there'd be room for the 16mb swap file there. Would it make any performance differences me putting the swap under /home or putting it on an ext2 sd card (the only option for the 32mb file)? I remember reading something in a past post about the sd/mmc driver that the Z uses tends to slow things down, but I can't remember or find the details.
I would create the swap file on your SD-card as opposed to /home on your flash chip in the Z. It will not be quite as fast a swapfile on the card… but I wouldn’t want to keep rewriting to a swap on my Z’s flash chip. (just my opinion)

I’ve used a 16MB swapfile on my SD-card with my 5600 and played video with gxine, opened and used abiword (not at the same time) and never used more than 10MB of swap.

Greg

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Should I Make A Swap File?
« Reply #5 on: May 29, 2005, 11:19:55 am »
Quote
I would create the swap file on your SD-card as opposed to /home on your flash chip in the Z. It will not be quite as fast a swapfile on the card… but I wouldn’t want to keep rewriting to a swap on my Z’s flash chip. (just my opinion)

I’ve used a 16MB swapfile on my SD-card with my 5600 and played video with gxine, opened and used abiword (not at the same time) and never used more than 10MB of swap.[div align=\"right\"][a href=\"index.php?act=findpost&pid=81978\"][{POST_SNAPBACK}][/a][/div]
Thanks for the advice. Is there any difference in using multiple smaller swapfiles instead of one big one (say 4 8's as apposed to one 32)? I'm just thinking of flexibility, 'cause it took a long time to build the 32mb file. Using multiples of 8  would allow me to increase my swap size by 8 by just activatiing another file, & I could then reduce it the same way. Just trying to think ahead.

thanks again
GROG!

Greg2

  • Hero Member
  • *****
  • Posts: 790
    • View Profile
    • http://
Should I Make A Swap File?
« Reply #6 on: May 29, 2005, 02:27:39 pm »
Quote
Thanks for the advice. Is there any difference in using multiple smaller swapfiles instead of one big one (say 4 8's as apposed to one 32)? I'm just thinking of flexibility, 'cause it took a long time to build the 32mb file.
I've never used more then 1 swapfile on a Z... it sounds like it might slow things down. (just guessing)

It's strange that you said it took a long time to build the 32MB swapfile, because it seemed to take a long time to build a 16MB on my SD-card. I thought it was my imagination... now I'm not sure. I will have to check this out later because it doesn't seem to take very long on my 5500... maybe it's a 5600 (PXA250) kernel thing? I can't remember what kernel I was using when I made the swapfile.

Greg

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Should I Make A Swap File?
« Reply #7 on: May 29, 2005, 02:41:27 pm »
Quote
I've never used more then 1 swapfile on a Z... it sounds like it might slow things down. (just guessing)
I'll keep on poking around for info. Right now I have two 8mb swapfiles running instead of the one 16mb & it seems to be going fine. Free reports alls well anyway:

Code: [Select]
root@grond:/media/card/Documents/etc/init.d# free
              total         used         free       shared      buffers
  Mem:        30000        27660         2340            0          768
 Swap:        16368            0        16368
Total:        46368        27660        18708
I've tried running my problem program (gxine) both with one 16 & with the two 8's, no difference that I can tell so far.

Quote
It's strange that you said it took a long time to build the 32MB swapfile, because it seemed to take a long time to build a 16MB on my SD-card. I thought it was my imagination... now I'm not sure. I will have to check this out later because it doesn't seem to take very long on my 5500... maybe it's a 5600 (PXA250) kernel thing? I can't remember what kernel I was using when I made the swapfile.[div align=\"right\"][a href=\"index.php?act=findpost&pid=82035\"][{POST_SNAPBACK}][/a][/div]
I didn't time it, but I'm sure even the first 8mb file took 10-20 minutes for the dd command to finish, mkswap took just a second. I then just copied the file to make the others, i.e. 'cp swapfile-1 swapfile-2', etc. Even that took some time, though. but I didn't make much out of that.

thanks again for the help
GROG!