Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Size of swap partition during installation Post 302354052 by Scrutinizer on Thursday 17th of September 2009 02:34:30 AM
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.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Swap Partition Space

first of all, sorry about my english...I´m 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

2. 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

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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
swapinfo(1M)															      swapinfo(1M)

NAME
swapinfo - system paging space information SYNOPSIS
DESCRIPTION
prints information about device and file system paging space. also prints information about primary paging device for next boot. (Note: the term `swap' refers to an obsolete implementation of virtual memory; HP-UX actually implements virtual memory by way of paging rather than swapping. This command and others retain names derived from `swap' for historical reasons.) By default, prints to standard output a two line header as shown here, followed by one line per paging area: The fields are: One of: Paging space residing on a mass storage device, either taking up the entire device or, if the device contains a file system, taking up the space between the end of the file system and the end of the device. This space is exclusively reserved for paging, and even if it is not being used for paging, it cannot be used for any other purpose. Device paging areas typically provide the fastest paging. Dynamic paging space available from a file system. When this space is needed, the system creates files in the file system and uses them as paging space. File system paging is typically slower than device paging, but allows the space to be used for other things (user files) when not needed for paging. File system paging space (see above) on a file system residing on a local disk. File system paging space (see above) on a file system residing on another machine. This file system would have been mounted on the local machine via NFS. Paging space on reserve. This is the amount of paging space that could be needed by processes that are currently running, but that has not yet been allocated from one of the above paging areas. See "Paging Allocation" below. Memory paging area (also known as pseudo-swap). This is the amount of system memory that can be used to hold pages in the event that all of the above paging areas are used up. See "Paging Allocation" below. This line appears only if memory paging is enabled. The total available space from the paging area, in blocks of 1024 bytes (rounded to nearest whole block if necessary), including any paging space already in use. For file system paging areas the value is not necessarily constant. It is the current space allocated for paging (even if not currently used), plus the free blocks available on the file system to ordinary users, minus RESERVE (but never less than zero). AVAIL is never more than LIMIT if LIMIT is non-zero. Since paging space is allocated in large chunks, AVAIL is rounded down to the nearest full allocation chunk. For the memory paging area this value is also not necessarily constant, because it reflects allocation of memory by the kernel as well as by processes that might need to be paged. The current number of 1-Kbyte blocks used for paging in the paging area. For the memory paging area, this count also includes memory used for other purposes and thus unavailable for paging. The amount of space that can be used for future paging. Usually this is the difference between Kb AVAIL and Kb USED. There could be a difference if some portion of a device paging area is unus- able, perhaps because the size of the paging area is not a multiple of the allocation chunk size, or because the tunable param- eter is not set high enough. The percentage of capacity in use, based on Kb USED divided by Kb AVAIL; 100% if Kb AVAIL is zero. For device paging areas, START is the block address on the mass storage device of the start of the paging area. The value is normally 0 for devices dedicated to paging, or the end of the file system for devices containing both a file system and paging space. For file system paging areas, LIMIT is the maximum number of 1-Kbyte blocks that will be used for paging, the same as the limit value given to A file system LIMIT value of means there is no fixed limit; all space is available except that used for files, less the blocks represented by (see tunefs(1M)) plus RESERVE. For device paging areas, this value is always ``--''. For file system paging areas, this value is the number of 1-Kbyte blocks reserved for file system use by ordinary users, the same as the reserve value given to The same as the priority value given to This value indicates the order in which space is taken from the devices and file systems used for pag- ing. Space is taken from areas with lower priority values first. priority can have a value between 0 and 10. See "Paging Allocation" below. For device paging areas, the block special file name whose major and minor numbers match the device's ID. The command searches the tree to find device names. If no matching block special file is found, prints the device ID (major and minor values), for example, For file system swap areas, NAME is the name of a directory on the file system in which the paging files are stored. When used with -s option, also prints to standard output a three line header as shown here, followed by one line for the primary paging area configured for next boot: The fields are: swapon(1M) can configure primary paging area for next boot on a storage device only. The paging space configured for next boot resides on a mass storage device, either taking up the entire device or, if the device contains a file system, taking up the space between the end of the file system and the end of the device. For device paging areas, START is the block address on the mass storage device of the start of the paging area. The value is normally 0 for devices dedicated to paging, or the end of the file system for devices containing both a file system and paging space. This is same as the value given to swapon(1M) when configuring primary paging area for next boot. LENGTH is the maximum number of blocks that will be used for paging. This is same as the value given to swapon(1M) when configuring primary paging area for next boot. The block special file name whose major and minor numbers match the device's ID. The command searches the tree to find device names. If no matching block special file is found, prints the device ID (major and minor values), for example, Paging Allocation Paging areas are enabled at boot time (for device paging areas configured into the kernel) or by the command (see swapon(1M)), often invoked by during system initialization based on the contents of When a paging area is enabled, some portion of that area is allocated for paging space. For device paging areas, the entire device is allocated, less any leftover fraction of an allocation chunk. (The size of an allocation chunk is controlled by the tunable parameter and is typically 2 MB.) For file system paging areas, the minimum value given to (rounded up to the nearest allocation chunk) is allocated. When a process is created, or requests additional space, space is reserved for it by increasing the space shown on the line above. When paging activity actually occurs, space is used in one of the paging areas (the one with the lowest priority number that has free space available, already allocated), and that space will be shown as used in that area. The sum of the space used in all of the paging areas, plus the amount of space reserved, can never exceed the total amount allocated in all of the paging areas. If a request for more memory occurs which would cause this to happen, the system tries several options: 1. The system tries to increase the total space available by allocating more space in file system paging areas. 2. If all file system paging areas are completely allocated and the request is still not satisfied, the system will try to use memory paging as described on the line above. (Memory paging is controlled by the tunable parameter which defaults to 1 (on). If this parameter is turned off, the line will not appear.) 3. If memory paging also cannot satisfy the request, because it is full or turned off, the request is denied. Several implications of this procedure are noteworthy for understanding the output of o Paging space will not be allocated in a file system paging area (except for the minimum specified when the area is first enabled) until all device paging space has been reserved, even if the file system paging area has a lower priority value. o When paging space is allocated to a file system paging area, that space becomes unavailable for user files, even if there is no pag- ing activity to it. o Requests for more paging space will fail when they cannot be satisfied by reserving device, file system, or memory paging, even if some of the reserved paging space is not yet in use. Thus it is possible for requests for more paging space to be denied when some, or even all, of the paging areas show zero usage -- space in those areas is completely reserved. o System available memory is shared between the paging subsystem and kernel memory allocators. Thus, the system may show memory pag- ing usage before all available disk paging space is completely reserved or fully allocated. Logical Volume Manager (LVM) The command displays swap logical volume if the system was installed with LVM. To modify swap logical volume, refer to the LVM commands and manpages for and For example, to remove a swap logical volume, run the following LVM command: Options recognizes the following options: In addition to printing information about device and file system paging space that are currently in use, will also print information about primary paging area configured for next boot using swapon(1M). If the primary paging area for next boot has not been configured using swapon(1M), will not be able to display any informa- tion. In this case will display the error message - "Primary swap for next boot was not set using swapctl()" Display the AVAIL, USED, FREE, START, LIMIT, and RESERVE values in Mbytes instead of Kbytes, rounding off to the nearest whole Mbyte (multiples of The output header format changes from to accordingly. Add a totals line with a TYPE of This line totals only the paging information displayed above it, not all paging areas; this line might be misleading if a subset of is specified. Show all device paging areas, including those configured into the kernel but currently disabled. (These are normally omitted.) The word appears after the NAME, and the Kb AVAIL, Kb USED, and Kb FREE values are 0. The option is ignored unless the option is present or is true by default. Print information about device paging areas only. This modifies the output header appropriately. Print information about file system paging areas only. This modifies the output header appropriately. Categorize file system paging area information into areas and areas, instead of calling them both areas. Print information about reserved paging space only. Print information about memory paging space only. The and options can be combined. The default is Quiet mode. Print only a total "Kb AVAIL" value (with the option, Mb AVAIL); that is, the total paging space available on the system (device, file system, reserve, or memory paging space only if or is specified), for possible use by programs that want a quick total. If is specified, the and options are ignored. Print a warning about each device paging area that contains wasted space; that is, any device paging area whose allocated size is less than its total size. This option is effective only if is also specified or true by default. RETURN VALUE
returns 0 if it completes successfully (including if any warnings are issued), or 1 if it reports any errors. DIAGNOSTICS
prints messages to standard error if it has any problems. EXAMPLES
List all file system paging areas with a totals line: WARNINGS
needs kernel access for some information. If the user does not have appropriate privileges for kernel access, will print a warning and assume that the defaults for that information have not been changed. Users of must not rely on the exact field widths and spacing of its output, as these will vary depending on the system, the release of HP- UX, and the data to be displayed. The information in this manual page about paging allocation and other implementation details may change without warning; users should not rely on the accuracy of this information. AUTHOR
was developed by HP. SEE ALSO
lvlnboot(1M), lvrmboot(1M), swapon(1M), swapon(2), swapctl(2), fstab(4). swapinfo(1M)
All times are GMT -4. The time now is 01:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy