Visit Our UNIX and Linux User Community


Size of swap partition during installation


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Size of swap partition during installation
# 8  
Old 09-16-2009
Not entirely. Ample paging space may enable you to fit more processes into RAM - even if no actual pageouts occur - while maintaining system stability. This has to do with the nature of demand paging.
# 9  
Old 09-16-2009
I'm not sure I follow you. How does swap space help demand-paging page in things not swap-related? I know Windows requires every bit of mapped memory to be backed by swap, but didn't think UNIX had this limitation...
# 10  
Old 09-16-2009
No idea about how Windows work but Unix, at least both modern Unixes & Linux do not require RAM to be backed by swap, hopefully.
# 11  
Old 09-16-2009
Quote:
Originally Posted by Corona688
I'm not sure I follow you. How does swap space help demand-paging page in things not swap-related? I know Windows requires every bit of mapped memory to be backed by swap, but didn't think UNIX had this limitation...
I would not call it a limitation, but rather a more conservative choice. Advance backup swap reservation ensures that when memory gets really strained, the OS doesn't waste cycles allocating pages, but can start paging out immediately, which can lead to better stability. E.g. HP-UX uses this strategy which is still a modern OS. Some OS'es start out liberally, but gradually change strategy as memory strain grow and start allocating more paging space.

But what I meant is that in any case it makes sense to have at least the amount of RAM in paging space regardless of strategy. The total allocatable memory equals RAM + swap space (unless you tune the OS to overcommit memory, which can be dangerous).

On a demand paging OS, processes typically make larger memory reservations than they actually use, often a factor 2 or 3. So suppose you have 3 programs that claim 1 GiB of memory, but in practice only really use 512MiB, then all of them can safely run on a 2 GiB system with 2GiB of swap, whereas you would only be able to run 2 of them if the system only had 512MiB swap.
Even though the 2GiB RAM / 2GiB swap system would run 3 processes that in total claim 3 GiB, the swap file would not be used for paging.
# 12  
Old 09-16-2009
Quote:
Originally Posted by Scrutinizer
I would not call it a limitation, but rather a more conservative choice. Advance backup swap reservation ensures that when memory gets really strained, the OS doesn't waste cycles allocating pages, but can start paging out immediately
Let me get this straight... It wastes cycles in advance, to waste swap in advance, so processes can allocate vastly more memory than they need and just not instantiate it, to avoid overcommit problems. In what sense is this conservative?

Overcommit may be dangerous in some circumstances, but there isn't enough disk space in the world to swap-back a 64-bit address space.
# 13  
Old 09-17-2009
HP-UX has indeed this bizarre approach by default and is the only current Unix lacking virtual swap. This design limitation can be partially overcome by enabling pseudo-swap.

Overcomitting memory is a different and dubious beast.
# 14  
Old 09-17-2009
Quote:
Originally Posted by Corona688
Let me get this straight... It wastes cycles in advance, to waste swap in advance, so processes can allocate vastly more memory than they need and just not instantiate it, to avoid overcommit problems. In what sense is this conservative?

Overcommit may be dangerous in some circumstances, but there isn't enough disk space in the world to swap-back a 64-bit address space.
Hi Corona688,

It does not waste cycles, it just reserves the appropriate amount of paging space in one go when a process starts, so it does not have to do it in small bits for every page it needs in strained memory conditions when there may also be a lot of CPU usage. In this sense it is conservative. It does not actually use the paging space. it just reserves it. These are just design choices, each with their own pros and cons.

Also, this is not about inefficient apps, but about reaping the benefits of demand paging and efficient memory use, or in other words, not needlessly wasting RAM.

---------- Post updated at 10:34 PM ---------- Previous update was at 09:25 PM ----------

Quote:
Originally Posted by jlliagre
HP-UX has indeed this bizarre approach by default and is the only current Unix lacking virtual swap. This design limitation can be partially overcome by enabling pseudo-swap.

Overcomitting memory is a different and dubious beast.
Hi jlliagre,

Actually pseudo-swap is the default on HP-UX systems. I think virtual swap or pseudo-swap is a terrible idea, especially if you make it the default. It leads admins into thinking that they do not need to allocate swap space, while there are penalties involved in doing so.

It effectively means you are using memory for paging space, well basically you are marking pages as non-pageable. This part of memory will then fill up much more quickly than usual, so in fact you are throwing away the benefit of demand-paging while keeping its downside.

Also what happens under load is that only a small part of memory actually gets paged out and if paging then occurs, then instead of a smooth transition it will be much more abruptly with the most recent processes taking the brunt.

In other words the system will waste copious amounts of memory and becomes less stable under load. The only time it is useful is when you have much more internal memory then you are ever going to need or you do not have room for swap space.

S.
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #321
Difficulty: Medium
DHCP stands for Dynamic Host Configuration Port.
True or False?

10 More Discussions You Might Find Interesting

1. Solaris

/tmp size is less whereas size allocated to swap is more

Hi, the /tmp size is less whereas the size allocated to swap is quite big. how to increase the size of /tmp - #: swap -l swapfile dev swaplo blocks free /dev/md/dsk/d20 85,20 8 273096 273096 #: swap -s total: 46875128k bytes allocated + 2347188k reserved =... (2 Replies)
Discussion started by: psb74
2 Replies

2. HP-UX

Could I mount a swap/dump partition on /tmp?

Hey Guys. Let show our disk-mapping structure on HP-UX B11.11 with df : # df /home (/dev/vg00/lvol5 ): 18979652 blocks 1224395 i /opt (/dev/vg00/lvol4 ): 120276192 blocks 1894100 i /var (/dev/vg00/lvol6 ): 19380328 blocks ... (3 Replies)
Discussion started by: aggadtech08
3 Replies

3. Filesystems, Disks and Memory

Partition 1 swap not mounting ?

Hi, running mount, I get the following, no part1 swap as part1 swap has been created and is listed below. System works fine anyway. As I cannot unmount part1, what is a standard procedure to make part1 on. Jack ============= .. $ free total used free shared buffers cached Mem:... (2 Replies)
Discussion started by: jack2
2 Replies

4. Solaris

swap partition showing mounted in df -h

Dear All Anyone can help me what is the problem of swap partition? swap partition is showing mounted in df -h command output. Regards prakash (1 Reply)
Discussion started by: pshelke
1 Replies

5. Linux

How to give UUID to a swap partition?

Dear Folks Is there anyway to give a UUID to a swap partition? mkswap on CentOS 5 (util-linux-2.13-0.45.el5_1.1) appears to override this option ;-( # swapoff -a # mkswap -L swap1 /dev/sda3 Setting up swapspace version 1, size = 4293591 kB LABEL=swap1, no uuid And there's no... (3 Replies)
Discussion started by: Santi
3 Replies

6. Linux

swap partition?

What does a swap partition do exactly? I was messing arround with a linux machine at my school and i deleted the swap partition using fdisk and then rebooted the machine and it worked fine and wrote a swap partition back in...lol. Is it a nessary part of the OS to use that partition? (7 Replies)
Discussion started by: byblyk
7 Replies

7. UNIX for Dummies Questions & Answers

Linux/Windows Fat32 Swap partition.

I run a dual boot WinXP/Red Hat 8 system on my laptop. Since my hard drive is inherently small(laptop) I am trying to creat a swap partition for keeping mutually used files such as music/video etc... I have created a 2.5GB Fat32 partition with Partition Magic Pro and have windows recognizing the... (2 Replies)
Discussion started by: djtrippin
2 Replies

8. UNIX for Dummies Questions & Answers

Size of swap

Hy all, i've a little problem with the size of the swap. I've an old solaris machine, with 4Go, and swap is taking 500Mo for only 1% used at any time. So : how can i change this size without problems ????? (ok it may be a stupid question, but it's a real problem when you lose about 1 or 2... (3 Replies)
Discussion started by: Olivier
3 Replies

9. UNIX for Dummies Questions & Answers

Linux Swap Partition

How big do I set the swap partition when i'm setting up my hard drive to install RedHat. (Using Partition Magic) thanks! primal (2 Replies)
Discussion started by: primal
2 Replies

10. UNIX for Dummies Questions & Answers

Swap Partition Space

first of all, sorry about my english...Im a spanish newbie to this marvelous OS and i have just a couple of doubts...u know? :-) 1) how big should my swap partition be if i installed debian 2.2r3 or FreeBSD 4.x on a AMD k7 1400Mhz with 512Mb of Random Access Memory? i heard that those OS... (1 Reply)
Discussion started by: I[X]ION
1 Replies

Featured Tech Videos