Does running without swap memory hurt performance?

Using applications, configuring, problems
Message
Author
illidan.modeler
Posts: 37
Joined: Mon 02 Sep 2013, 17:22

Does running without swap memory hurt performance?

#1 Post 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?
Laptop1(Core i3, 2G , 320G ): Ubuntu 12.04
Laptop2(Celeron SU2300, 2G , 320G ): Lubuntu 13.04
Laptop3(Turion64 MT28, 1280M, 40G): Bodhi 2.4 with E17
External HDD1: SalixOS 14.0 with fvwm
External HDD2: Blag Linux and GNU 140k
Pen Drive: Slacko 5.6

gcmartin

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

#2 Post 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

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#3 Post 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 .

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#4 Post 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

illidan.modeler
Posts: 37
Joined: Mon 02 Sep 2013, 17:22

#5 Post 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?
Laptop1(Core i3, 2G , 320G ): Ubuntu 12.04
Laptop2(Celeron SU2300, 2G , 320G ): Lubuntu 13.04
Laptop3(Turion64 MT28, 1280M, 40G): Bodhi 2.4 with E17
External HDD1: SalixOS 14.0 with fvwm
External HDD2: Blag Linux and GNU 140k
Pen Drive: Slacko 5.6

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#6 Post 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 .
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#7 Post 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

gcmartin

#8 Post 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?

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#9 Post 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

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#10 Post 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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#11 Post by bigpup »

Yes, at bootup, Puppy will automatically detect and use a swap partition or swap file that is on computer.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#12 Post 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.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#13 Post 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
Attachments
slaxsave.zip
(11.92 KiB) Downloaded 237 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#14 Post 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

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#15 Post by musher0 »

All right, then.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

illidan.modeler
Posts: 37
Joined: Mon 02 Sep 2013, 17:22

#16 Post 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.
Laptop1(Core i3, 2G , 320G ): Ubuntu 12.04
Laptop2(Celeron SU2300, 2G , 320G ): Lubuntu 13.04
Laptop3(Turion64 MT28, 1280M, 40G): Bodhi 2.4 with E17
External HDD1: SalixOS 14.0 with fvwm
External HDD2: Blag Linux and GNU 140k
Pen Drive: Slacko 5.6

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#17 Post 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 .

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#18 Post 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
Last edited by mikeb on Tue 17 Sep 2013, 13:44, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#19 Post 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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#20 Post 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

Post Reply