Page 2 of 2

Posted: Tue 05 Jun 2007, 14:41
by Flash
Sage is right that adding RAM is the best solution, but I'll stand by my statement that too much swap memory is nothing more than a waste of hard disk space. :)

Posted: Tue 05 Jun 2007, 15:06
by GuestToo
my swap space is about 900 megs, but i have /tmp mounted as a tmpfs file system ... that is, my /tmp is in ram and uses the swap space if needed

i usually compile apps in /tmp, and i often download large files, like 700 meg iso's, to /tmp ... which means i'm downloading to the swap space

if i burn a cd, i often use dvdisaster to read an iso file from the cd, which i usually put in /tmp, then i make an error correction file for the iso

i could use /tmp, which on my machine is ram+swap space, as temporary storage for iso files when i burn a cd, but i usally pipe mkisofs directly to cdrecord, so i usually don't need any temporary space

Posted: Tue 05 Jun 2007, 19:59
by Runemaster
Reading this thread makes me think back to the days of messin with 'doze. XP's default Virtual memory (swap file) size is set to 2.0gb regardless of system memory, and with everyone out there gobbling up these $300 comps
that only come with 256 system memory. This makes windows yet again sound more and more inefficient. Although like with many of you have said circumstances usually dictate the size of the swap file needed. But I would bet money on the fact that if you limited it to 1.0gb (based on what the averge person uses the pc for) performance would slightly increase. Unless your running a program like SolidWorks (engineering program, graphically intense) or playing Rome - Total War which was sponsored by the history channel a while back, in which case my freind would often get the system message saying the his virtual memory is dangerously low with hiw 256meg, 2.0gb virtual memory.

Posted: Tue 05 Jun 2007, 20:22
by Flash
Here's a quote from this web page:
...If you don't have swap space, then anonymous mappings can't be flushed. They have to stay in memory until they're deleted. The kernel can only obtain clean memory and free memory by flushing out file-backed pages: programs, libraries, and data files. Not having swap space constrains and unbalances the kernel's page allocation. However unlikely it is that the data pages will be used again — even if they're never used again — they still need to stay in memory sucking up precious RAM. That means the kernel has to do more work to write out file-backed pages, and to read them back in after they're discarded. The kernel needs to throw out relatively valuable file-backed pages, because it has nowhere to write relatively worthless anonymous pages.

Not only this, but flushing pages to swap is actually a bit easier and quicker than flushing them to disk: the code is much simpler, and there are no directory trees to update. The swap file/partition is just an array of pages. This is another reason to give the kernel the option of flushing to swap as well as to the filesystem...
If I read it right, not having enough swap space actually causes Linux to thrash the disk, in an effort to keep some RAM free for immediate use. There is nothing in the article that suggests there is a penalty for having too much swap memory. There may be a limit of 2048 MB of swap that Linux will recognize. Obviously, swap space which is never used could have been used for recording files to disk.

Here's another, later article, explaining Linux' virtual memory management.

Posted: Tue 05 Jun 2007, 20:29
by Runemaster
I've noticed that Windows also does this as well before i upgraded my dad's laptop from 256 to 512. most likely used as "elbow room" if you see what I mean.

Swap Partition Open Office .sfs solved

Posted: Wed 06 Jun 2007, 03:34
by ndujoe1
I created a small swap partition 256 mb and the Open Office .sfs came up fine.

Posted: Wed 06 Jun 2007, 16:33
by Pence
Looks like Ubuntu created a 747.0 mb swap partition on my computer.Seems to work fine with Puppy also.

Large swap can give problems

Posted: Fri 13 Jun 2008, 16:48
by pigshed
Just an example of a potential problem with having an oversized swap partition.

On an old PIII 600 laptop with 320mb ram, I'd followed the old theories of double the memory for the swap file (an xubuntu installation also did the same thing). So I had a 690mb swap file.

Running Puppy Dingo 4.00 this didn't seem to present any problems, it just sat there unused and wasted as Dingo easily fitted into RAM.

Installing Muppy 8.3e Standard, the machine was painfully slow ..

As the swap was over 650mb (the size of the main muppy file), Muppy was loading itself into the swap and running from there... Reduce the swap down to 256mb, and it flies !

I wonder if this affects all puplets running on machines where there is insufficient RAM to load everything into memory - yet with a large enough swap file to accommodate the main SFS ?? for instance for similar machines to mine with 320mb ram so other linux distro's would have created a 700mb ish swap file already on the HD ? Or is this a Muppy quirk ? As a linux/puppy newby, whilst trying different distro's this would have put me off and I'd have been none the wiser and would probably have moved on and wondered what all the fuss was over the new puppy ... :-)

Cheers, Adam.

Posted: Thu 03 Jul 2008, 04:41
by alienjeff
WhoDo wrote:For the average user, if you have 512Mb RAM or more your swap partition is superfluous in Puppy, and most other distros. It simply won't ever be used so why waste the space?
When running Puppy v2.12 on a machine with a gig of RAM, I go into swap usage fairly regularly. So the operative words in #4 of WhoDo's list are "average users." It's more a matter of personal computing habits than strict HW considerations.

Posted: Sat 02 Jan 2010, 20:00
by PupGeek
Agreed jeff. I have made ProducerPup available, and it has GIMP. I have gotten the distro to run on an old 400 MHz Pentium II box with 320 MB RAM with a 1GB swap partition and it ran well. While running it on a 2.6 GHz system containing 512 MB RAM and no swap, GIMP kept on crashing with 6 Megapixel images until i plugged a flash drive in and activated the 1 GB swap on it.

To those who say puppy is not meant to run large apps, it may not be intended to run such apps in live or frugal mode, but I'm pretty sure that a full HDD install would pretty much eliminate such limitations associated with using large apps with a live session...... by nature it does not have to load the main .sfs file into RAM, thus, freeing up more memory and having to use swap a lot less.

I can also agree that more RAM is a better way to go than increasing swap... I usually format a 1GB swap partition simply because it is a nice round figure. If you notice excessive HD access while a swap is in use, the true solution is adding more memory. And I like the analogy of RAM being a workbench and swap being the drawers.


Also, a few tips for reducing your dependence on RAM and swap:
  • Use Roxapps or .sfs files instead of including them in the remaster.

    If you have an available partition or free HD or flash drive space, try moving directories such as "my-roxapps" and "my-documents" to that partition and linking them into your /root directory instead.... this will eliminate the need to keep the contents of those directories loaded into RAM or swap.

    If a roxapp needs certain directories to exist in your system directories, then have the AppRun script link those directories or files to those locations and also remove the links when the app shuts down. Removing the links is important to maintain a clean filesystem and keep your pup_save file from constantly expanding.

    Remember that when puppy is booted in live or frugal mode, its main .sfs is loaded into RAM and your pup_save file may be as well, so anything that can keep the pup_save file to a minimum can help reduce your dependence on swap space. Thinking about that, maybe running a plain-jane puppy and using roxapps and sfs modules is better for performance. Sfs files are good because they do not load into RAM when simply mounted. Combining their use with a roxapp's AppRun script to do all the preparations and export all environment variables is a good way to run apps in puppy while not taking up needless amounts of RAM.