Using a swapfile when not having a savefile

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

Using a swapfile when not having a savefile

#1 Post by nic007 »

Can someone confirm that using a swapfile if you don't have a savefile actually works? I work without a savefile, am able to activate a swapfile but I can't see that it is actually in operation (can't see any swapping taking place).

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

Re: Using a swapfile when not having a savefile

#2 Post by musher0 »

nic007 wrote:Can someone confirm that using a swapfile if you don't have a savefile actually works. I work without a savefile, am able to activate a swapfile but I can't see that it is actually in operation (can't see any swapping taking place).
Hi nic007.

A swap file and a pupsave are two entirely different and unrelated
things. Why do you ask?

The swap file is related to the Linux system and the pupsave to Puppy.

Puppy is able to create a 250 Mb swap file automatically if during the
boot sequence it detects that the PC does not have enough RAM for the
Puppy to operate entirely from RAM -- before it starts looking for a
pupsave file. Nowadays, with PCs having more RAM ex-factory, this old
Puppy feature probably never comes into play.

The command to see if your swap is occupied even slightly is

Code: Select all

free
(last line).

Code: Select all

htop
will also show you, usually last line in the top left section,
before the program listings.

Also, as you may already know, the swap file and swap partition are
relics of the past, when PCs had much less RAM than they have now.

Nowadays a swap file or partition of 500 Mb is more than enough,
whereas back in the day, 2.5 times the amount of RAM was
recommended as swap.

My swap partition never had more than 25 Mb in it, even when my PC
had only 1.5 Gb of RAM. 99 % of the time my swap space has 0 bytes
in it -- the way it should be!

Suspect swap space is being used when your computer's operations
become sluggish and slower than usual, "disk memory" as it is also
called, offering much slower access than RAM access.

IHTH
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

#3 Post by nic007 »

I'm asking because the swapfile does not seem to be accessed when one is working without a savefile even when it is activated with swapon. I remember many years ago when I still had a savefile and a swapfile that I could see some activity with regards to the swapfile even if swapping was not necessarily needed (one could still see some swapping taking place even it was a few kb's). However, I run without a savefile and activating a swapfile does not make the swapfile operational (well not as far as I notice). I have 2GB of RAM but nevertheless, there should be some indication that some swapping is being done (but free reports zero swapping). I'm aware that if you do have a savefile, any swapfile will be activated and operational at bootup automatically as puppy searches for swapfiles at bootup (that is when you have a savefile but not otherwise ).

I would like to hear from someone who has very little RAM, requires a working swapfile (not swap partition in this test) and does NOT have a savefile. It's possible that I have enough RAM so no swapping is being showed but I'm sceptical.

It seems to me that the swapfile only works when the working partition is /mnt/home (thus operating puppy with a savefile)?
Last edited by nic007 on Wed 04 Apr 2018, 08:00, edited 1 time in total.

User avatar
drunkjedi
Posts: 882
Joined: Mon 25 May 2015, 02:50

Re: Using a swapfile when not hav

#4 Post by drunkjedi »

musher0 wrote:Also, as you may already know, the swap file and swap partition are
relics of the past, when PCs had much less RAM than they have now.

Nowadays a swap file or partition of 500 Mb is more than enough,
whereas back in the day, 2.5 times the amount of RAM was
recommended as swap.
Yes, that's what I thought too.
When I assembled my PC, I made a 12Gb swap partition (twice of my 6Gb RAM, I was going to install Ubuntu, but then found puppy).
I don't see any use of it, was thinking of formatting it.

But then I saw Hibernation in Fatdog. Which uses swap file/partition.

I will test it before formatting.

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#5 Post by watchdog »

"Swappiness" (search for it) can modify the edge when a swap file is activated.

Code: Select all

echo 10 > /proc/sys/vm/swappiness
10 is recommended for full use of RAM without using much the swap file. You can test with 50 or 70 to activate the swap file very soon. But only for test. When the swap file is used then you'll see a slowness of PC swapping on the hd.

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

#6 Post by nic007 »

I simply want to know if someone has had success with using a swapfile if they aren't using a savefile. This is not a difficult question people. :?

User avatar
Galbi
Posts: 1098
Joined: Wed 21 Sep 2011, 22:32
Location: Bs.As. - Argentina.

#7 Post by Galbi »

Htop can tell if swap is being used.
Attachments
2018-04-04.png
(54.5 KiB) Downloaded 245 times
Remember: [b][i]"pecunia pecuniam parere non potest"[/i][/b]

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

#8 Post by musher0 »

Removed, because inaccurate.
Last edited by musher0 on Thu 05 Apr 2018, 18:02, edited 1 time in total.
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

#9 Post by nic007 »

Oh my gawddd, I give up.

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

#10 Post by nic007 »

Galbi wrote:Htop can tell if swap is being used.
yes, and so does the free command, it stays at 0 swap used (no matter how long the session and extensive the usage) but ONLY happens when I do not run a savefile. When I have a savefile, the swapfile is activated "correctly" and I can actually see activity with the swapfile from the start. So, why is that?

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

#11 Post by musher0 »

You have a PC with very little RAM?

Sorry for not guessing this correctly earlier. For such a question, providing
HW specs at the start would have been helpful in guiding the answer.

Try adding nocopy in your "pfix=" boot parameters. Then a lot of the
puppy_xxx.sfs and pupsave contents will stay on disk, only a minimum of
executables will be loaded in RAM, and your swap space may not even
need to be activated.

Regards.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

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

#12 Post by musher0 »

Also it may depend on the size of the pupsave. A large pupsave and a small
amount of RAM will almost surely mean more swap file activity.
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

#13 Post by bigpup »

nic007 wrote:
Galbi wrote:Htop can tell if swap is being used.
yes, and so does the free command, it stays at 0 swap used (no matter how long the session and extensive the usage) but ONLY happens when I do not run a savefile. When I have a savefile, the swapfile is activated "correctly" and I can actually see activity with the swapfile from the start. So, why is that?
To answer this:
What version of Puppy?
How much RAM is in the computer and is being used at the time you see this?
Is the savefile for a live CD or frugal install on a hard drive or usb flash drive? This affects how the savefile loads.

Swappiness is a Linux kernel parameter. (0 to 100)
The default is 60.
If there is no setting made to change this, it would default to 60.
Swap would start at 40% RAM usage.

Older versions of Puppy may not use a different setting from default 60.

Example:
Xenialpup64 7.5 uses 10 setting.
Swap does not get used until 90% of RAM is used.
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)

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#14 Post by watchdog »

I'm guessing that there is something wrong in your swap file. Where is it? Consider that /mnt/home is not disposable in a live session. You should mount sda1 and create a swapfile in /mnt/sda1 for example. Am I guessing right?

User avatar
drunkjedi
Posts: 882
Joined: Mon 25 May 2015, 02:50

Re: Using a swapfile when not having a savefile

#15 Post by drunkjedi »

nic007 wrote:Can someone confirm that using a swapfile if you don't have a savefile actually works? I work without a savefile, am able to activate a swapfile but I can't see that it is actually in operation (can't see any swapping taking place).
I too work without savefile mostly.
But I have too much RAM (6gb) so never seen my swap being used.
My ram highest filled to about 3.5gb only.

But your thread did remind me to check out hibernation feature in Fatdog which uses swap space to store system state while shutdown.
It works like a charm, every program and it's window is as it is on resume boot. But I don't think I will need it, so will delete the swap if space is needed.

Anyway, I would suggest trying what watchdog suggested about "swappiness", but set it to 100 instead of 10, so that it would swap everything in ram. Just to check if the swapping business is working.

I did "cat /proc/sys/vm/swappiness" in my system and it returned 60 as answer. so swappiness is quite high by default.

HerrBert
Posts: 152
Joined: Thu 03 Nov 2016, 15:11
Location: NRW, Germany

Re: Using a swapfile when not having a savefile

#16 Post by HerrBert »

nic007 wrote:Can someone confirm that using a swapfile if you don't have a savefile actually works? I work without a savefile, am able to activate a swapfile but I can't see that it is actually in operation (can't see any swapping taking place).
i can confirm this. i use a swapfile without having a savefile and it gets used, when i browse big sites on the web
Attachments
Screenshot_2018-04-21_173011.jpg
(17.34 KiB) Downloaded 124 times

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

#17 Post by nic007 »

Thanks!

User avatar
Uten
Posts: 129
Joined: Tue 29 Jan 2008, 11:00

#18 Post by Uten »

I always run frugal without a save file and can confirm that a swap file/partition will be used if the system runs low on memory.

A handy trick is to make a swapfile on the fly when you realize your going to run out of space (load 50 tabs in firefox with graphics and wait for it :lol: :lol: ).

https://www.cyberciti.biz/faq/linux-add ... ile-howto/

Post Reply