Page 1 of 2

Does running without swap memory hurt performance?

Posted: Wed 11 Sep 2013, 13:49
by illidan.modeler
I use my Slacko in a pen drive in various places on various computers. Some computers are without swap partitions purely machines for MS Windows. When I run Slacko on this kind of computers, will it result in poorer performance compared to one with swap partition?

Re: does it hurt performance when unning without a swap?

Posted: Wed 11 Sep 2013, 14:05
by gcmartin
illidan.modeler wrote:I use my Slacko in a pen drive in various places on various computers. Some computers are without swap partitions purely machines for MS Windows. When I run Slacko on this kind of computers, will it result in poorer performance compared to one with swap partition?
SWAP services will NOT hurt performance. Think of it as a system protection to keep the system alive as RAM use increases. This technology has been in the fore-forth of advance systems for more that 50 years. But, it is NOT required. In Linux, this can be turned on/off should anyone need. Most every PUP at boot-time will acknowledge its presence automatically, if it is present. If not, the PUP doesn't care and will still boot. And, system operations will perform normally for the user.

Hope this helps

Posted: Wed 11 Sep 2013, 14:38
by Karl Godt
Firefox is RAM hungry .

1GB is quite OK for most simple purposes . 2GB is very good .
When I compile large sources on my 1GB RAM machine in Full installation mode , then SWAP is seldom used and if in K sizes often .

512MB should be OK , but I would prefer SWAP then to increase RAM to 1GB .

On an old 224MB RAM machine with no HDD running Quirky-1.1live cd , Seamonkey Browser crashes when opening a second or third tab because of too low RAM .

Bugos in Apps can be RAM demanding , as I had to learn recently with the decimal point delimiter being comma in my LANG , not colon .

Posted: Wed 11 Sep 2013, 14:51
by mikeb
In terms of performance running with swap being used is a slow down. But running without enough ram and no swap will cause crashes or hard lockups. If you are running on machines with 1GB+ chances are you will be fine. Apps handling large images like GIMP or an untamed browser can chomp.
Also with puppy on a flash stick ram is shared between system ram usage and the ramdisk for the virtual file system so usage is higher than a more conventional system and say adding software or storing files in /root will take up ram space.

If you did need to use your stick where ram is limited or you need more you could have a save file on the stick (or even partition it for the partition way)...a save file is as fast as a partition on modern kernels.

mike

Posted: Wed 11 Sep 2013, 17:52
by illidan.modeler
Thanks for your clarifications.

I noticed that Puppy will make use of the swap partition if it's present in the PC's internal HDD.

Swap will be needed when many software applications run simultaniously, in order to switch inactive process to the background and map their memory into swap area. Right?

Can I confgiure Puppy to use swap if it's avaible inside the machine, and to use a swap file if swap partition isn't available?

Posted: Wed 11 Sep 2013, 17:58
by Karl Godt

Code: Select all

geany /etc/rc.d/rc.sysinit
and in the Find box type swap and hit the magnifier button to search .

Posted: Wed 11 Sep 2013, 19:31
by mikeb
Swap will be needed when many software applications run simultaniously, in order to switch inactive process to the background and map their memory into swap area. Right?
My understanding is Windows uses swap a bit differently and it can indeed affect performance without it.
On Linux its just extra space if the ram runs out so nothing gets 'swapped out' unless more real ram is required than free.

hope all this is helping :)

mike

Posted: Wed 11 Sep 2013, 21:03
by gcmartin
You pose a good question.
illidan.modeler wrote:Can I confgiure Puppy to use swap if it's avaible inside the machine, and to use a swap file if swap partition isn't available?
I had never considered this implementation for I've only used the OOTB support built-into many/most Linux systems.

Wondering
I have never used /setup any system where I deployed SWAP (or page for that matter) within the filesystem of the running system or its data areas.

If I understand your question, correctly, you would like the system, at boot time, to look for a swapfile when a swap partition is NOT found.

I dont know if PUPs are designed for this. And, I never implemented a swapfile on any system. Maybe PUPs are built to already automatically do this. Anyone know?

Posted: Wed 11 Sep 2013, 21:17
by mikeb
Ok this is from Lucid...if no swap partition then it tries to load pupswap.swp located in the root of the save drive...

Code: Select all

 #if no go, try for a swap file...
 if [ "$SWAPON" != "yes" ];then
  SWAPFILE="/pupswap.swp"
  if [ -f /initrd${PUP_HOME}${SWAPFILE} ];then
   echo -n "Loading swap file ${SWAPFILE}..." >/dev/console
   swapon /initrd${PUP_HOME}${SWAPFILE}
   status_func $?
   [ $? -eq 0 ] && SWAPON="yes"
  fi
  if [ -f $SWAPFILE ];then
   echo -n "Loading swap file ${SWAPFILE}..." >/dev/console
   swapon $SWAPFILE
   status_func $?
   [ $? -eq 0 ] && SWAPON="yes"
  fi
 fi
It may well still be the case for newer puppies...

heres a swap file ..extract and enjoy..its magic :)
http://dl.dropbox.com/u/110545536/Puppy ... 512.tar.gz

mike

Posted: Wed 11 Sep 2013, 21:21
by musher0
Hello, all.

A couple of infos for the record:

1) windose has 2-3 swap files for various purposes, called
hiberfile.sys, pagefile.sys and the like. I don't know if explaining how
would be on subject, but there's a simple way for any Linux to use
pagefile.sys as a swap file.

2) at boot-up, if Puppy thinks there is not enough RAM and finds no swap file
or partition, it creates a small 256 Mg swap file, to have leg-room at
least until your pupsave file is created.

BFN.

Posted: Thu 12 Sep 2013, 03:01
by bigpup
Yes, at bootup, Puppy will automatically detect and use a swap partition or swap file that is on computer.

Posted: Thu 12 Sep 2013, 03:34
by nic007
gcmartin wrote:You pose a good question.
illidan.modeler wrote:Can I confgiure Puppy to use swap if it's avaible inside the machine, and to use a swap file if swap partition isn't available?
I had never considered this implementation for I've only used the OOTB support built-into many/most Linux systems.

Wondering
I have never used /setup any system where I deployed SWAP (or page for that matter) within the filesystem of the running system or its data areas.

If I understand your question, correctly, you would like the system, at boot time, to look for a swapfile when a swap partition is NOT found.

I dont know if PUPs are designed for this. And, I never implemented a swapfile on any system. Maybe PUPs are built to already automatically do this. Anyone know?
I've read somewhere on a puppy forum that puppy can utilise the drvespace.bin and pagefile.sys created by a windows installation as swap files.

Posted: Sat 14 Sep 2013, 02:03
by musher0
Hello nic007.

Here are a couple of articles I found on the subject:
http://www.linuxarticles.org/2010/10/li ... sing-file/

http://www.linuxquestions.org/questions ... ws-109511/
(The first part in blue, the post by a Mr. Hammond)

Attached is also slaxsave.zip taken from
http://www.homesopen.com/slax6/slax-boo ... -6.0.1.iso.
I don't think it's distributed with the newer slax or porteus distros
anymore, but it's always handy to have around.

Watch it! Surprisingly, there are 4 sizes of swap files in there ranging
from 128 Mg to 1 Gb, so make sure you have enough room on your
support drive (especially if a USB drive) when you unzip any one of
them. I'd recommend using the 512 Mb one, which is enough for our
purposes in Puppy.

I don't use any of them anymore since I now have a very large HD
with a swap partition, but a script similar to Mr. Hammond's above
did set the swap file up and it worked fine. If you're interested I'll
dig up this old script.

Another word of caution. The drive I used it on was formatted in
fat32. These swap files will certainly work on fat32 and extX drives,
but I'm not sure if they'll work on a windose ntfs drive right off the bat,
because a ntfs drive has to be opened and maintained open with the
Linux ntfs-3g utility to be written to.

BFN.

musher0

Posted: Sat 14 Sep 2013, 03:08
by nic007
musher0 wrote:Hello nic007.

Here are a couple of articles I found on the subject:
http://www.linuxarticles.org/2010/10/li ... sing-file/

http://www.linuxquestions.org/questions ... ws-109511/
(The first part in blue, the post by a Mr. Hammond)

Attached is also slaxsave.zip taken from
http://www.homesopen.com/slax6/slax-boo ... -6.0.1.iso.
I don't think it's distributed with the newer slax or porteus distros
anymore, but it's always handy to have around.

Watch it! Surprisingly, there are 4 sizes of swap files in there ranging
from 128 Mg to 1 Gb, so make sure you have enough room on your
support drive (especially if a USB drive) when you unzip any one of
them. I'd recommend using the 512 Mb one, which is enough for our
purposes in Puppy.

I don't use any of them anymore since I now have a very large HD
with a swap partition, but a script similar to Mr. Hammond's above
did set the swap file up and it worked fine. If you're interested I'll
dig up this old script.

Another word of caution. The drive I used it on was formatted in
fat32. These swap files will certainly work on fat32 and extX drives,
but I'm not sure if they'll work on a windose ntfs drive right off the bat,
because a ntfs drive has to be opened and maintained open with the
Linux ntfs-3g utility to be written to.

BFN.

musher0
Hi, musher0. Thanks. I've never used a swap file before. Running a customised version of puppy431 with Java and old WINE, save file of only 48MB, only 256MB RAM and still don't need a swap file. :D

Posted: Sat 14 Sep 2013, 15:12
by musher0
All right, then.

Posted: Tue 17 Sep 2013, 09:07
by illidan.modeler
Karl Godt wrote:

Code: Select all

geany /etc/rc.d/rc.sysinit
and in the Find box type swap and hit the magnifier button to search .
Nice. I've found the script snippet that deals with swap file. However, I notice that it tries to load a file named /pupswap.swp.

Will this file take up my space in save.2fs which is already tight? In addition, bigger save.2fs seems to take longer time to compress when I shut down the system. So I might need to balance between the time it takes to shut down and the room within the SAVE file preventing me from setting a too large SAVE file.

Posted: Tue 17 Sep 2013, 10:29
by Karl Godt

Code: Select all

 [ "$PSWAPFILE" ] && SWAPFILE="`echo -n "$PSWAPFILE" | cut -f 3 -d ','`"  #/etc/rc.d/PUPSTATE
Older? Pups created a pupswap.swp file in /etc/rc.d/rc.shutdown in special cases automatically .

Everything depends on the PUPMODE that you are running : Look into /etc/rc.d/PUPSTATE .


pupswap.swp in full installation should reside on toplevel=/ like Windows's pagefile.sys
and on fraggle insulation on /initrd${PUP_HOME} -- also look into PUPSTATE file for PUP_HOME

-- Cannot remember that PUP_HOME would be inside the pup_ro1 pupsave file , but there are few PUPMODEs out from PUPPY-VERSION-1 times mentioned here and there in the codes , that I never had the pleasure to experience myself .

Posted: Tue 17 Sep 2013, 12:04
by mikeb
Ok this is from Lucid...if no swap partition then it tries to load pupswap.swp located in the root of the save drive...

Code:
#if no go, try for a swap file...
if [ "$SWAPON" != "yes" ];then
SWAPFILE="/pupswap.swp"
if [ -f /initrd${PUP_HOME}${SWAPFILE} ];then
echo -n "Loading swap file ${SWAPFILE}..." >/dev/console
swapon /initrd${PUP_HOME}${SWAPFILE}
status_func $?
[ $? -eq 0 ] && SWAPON="yes"
fi
if [ -f $SWAPFILE ];then
echo -n "Loading swap file ${SWAPFILE}..." >/dev/console
swapon $SWAPFILE
status_func $?
[ $? -eq 0 ] && SWAPON="yes"
fi
fi


It may well still be the case for newer puppies...

heres a swap file ..extract and enjoy..its magic Smile
http://dl.dropbox.com/u/110545536/Puppy ... 512.tar.gz

mike
you obviously did not see this the first time lol
I must get a bath....
wibble wibble snidge and fluffle

bye

Posted: Tue 17 Sep 2013, 13:27
by musher0
This is what I would suggest, then:

Download and unzip the slaxsave.zip file attached above.
Unzip save512.zip. A slaxsave.dat file of 512 Mg will be unpacked.
Rename this slaxsave.dat to pupswap.swp.
Move this pupswap.swp to /mnt/home.
and at next boot you will have a 512 Mg swap file.

I do not wish to start an argument, but in my experience,
it doesn't make sense to put your swap file in / , since that
will only occupy space on your pupsave file.

I believe the proper place for it is on a disk partition
such as /mnt/sda1 or /mnt/sda2 (which are traditionally
the hard drives) or even on your USB drive if you
have space enough there.

Regards.

Posted: Tue 17 Sep 2013, 13:48
by mikeb
I do not wish to start an argument, but in my experience,
it doesn't make sense to put your swap file in / , since that
will only occupy space on your pupsave file.
No argument intended...in fact you made me realise my last post was unclear..I edited it... /swapsave.swp is for a full install (yes could be useful to full installers)... but for a frugal install its swapon /initrd${PUP_HOME}${SWAPFILE} which is indeed /mnt/home.... in both cases its in the root of the partition.
Note for anyone trying this no sub folders can be used.

Since this forum seems to be the unofficial wiki we all tend to try to add as much information as we can. :)

regards
mike