11-29-2013
I think that you're asking why, when you have RAM free, is there so much "swapped out".
The answer is that swap space is managed by the Operating System and is used as an extension of RAM. Otherwise the system would run out of RAM at some point especially when new processes need RAM space to launch.
However, if the working set (or part of a working set) is kicked out of RAM into swap space to make room for somebody else, the process swapped out will not be swapped back into RAM unless there is a need (ie, the process is ready to run). There may be no need to swap a process back in if, for example, it is waiting for I/O (to disk or network) to complete.
So, for example, a large new process starts which causes several other processes to be swapped out. That large process then finishes releasing RAM but there may be no need at that time to swap any processes back in. Hence, some RAM is free but swap space usage is high(er).
I don't know whether I've explained that clearly enough. Does that help?
This User Gave Thanks to hicksd8 For This Post:
10 More Discussions You Might Find Interesting
1. Solaris
Hello and thanks in advance.
I have a Sun box with raid 1 on the O/S disks using solaris svm.
I want to unmirror my swap partition, and add the slice on the second disk as an additional swap device. This would give me twice as much swap space.
I have been warned not to do this by some... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies
2. UNIX for Dummies Questions & Answers
ls displays files in tabbed output. Say a directory contains 3 files. ls will list all 3 in one line. So, I expect ls | wc -l to give 1, but it counts the nr of files and gives 3.
Can someone explain how this works? (3 Replies)
Discussion started by: krishmaths
3 Replies
3. Programming
pls explain me how this works....
DECODE (SUBSTR (field, 1, 1),'''', '''''' || field || '''','''' || field || '''')
here field is a column in an oracle table.... (7 Replies)
Discussion started by: vijay_0209
7 Replies
4. UNIX for Dummies Questions & Answers
When I try to execute script, I get message:
>aa.pl
zsh: command not found: aa.pl
but
>./aa.pl
works OK.
What to change in environment to force the former way to work?
Thank you,
Alex Z (4 Replies)
Discussion started by: zzol
4 Replies
5. Red Hat
free -m : 1023 total swap space
created default partition /dev/sdb1 50M using fdisk. i did write the changes.
#mkswap /dev/sdb1
#swapon /dev/sdb1
free -m : 1078 total swap space
this shows that the swap is on
Question : i did not change the type LINUX SWAP (82) in fdisk.
so why is... (5 Replies)
Discussion started by: dplinux
5 Replies
6. HP-UX
Hi
I have an integrity machine rx7620 and rx8640 running hp-ux 11.31. I'm planning to fine tune the system:
- I would like to know when does the memory swap space spill over to the device swap space?
- And how much % of memory swap utilization should be specified (swap space device... (6 Replies)
Discussion started by: lamoul
6 Replies
7. UNIX for Advanced & Expert Users
I have a program............
#include<stdio.h>
#include<unistd.h>
main()
{
if(fork == 0)
{
printf("Hi every body:p!!!!!!!!!!");
}
}
This program works with out any error. here fork is not a system call. It just act as a variable.But how it works without declaring it? What data type it... (19 Replies)
Discussion started by: carolsanjeevi
19 Replies
8. Solaris
Hi All,
I want to know how to understand the actual swap size.
My o/p shows as below
root@ecovs1a # swap -s
total: 4546056k bytes allocated + 358856k reserved = 4904912k used, 5046688k available
root@ecovs1a # swap -l
swapfile dev swaplo blocks free
/dev/md/dsk/d31 ... (9 Replies)
Discussion started by: vivek.goel.piet
9 Replies
9. Solaris
Hi Solaris Folks :),
I need to calculate the swap usage on solaris server, please let me understand the output of below swap -s and swap -l commands.
$swap -s
total: 1774912k bytes allocated + 240616k reserved = 2015528k used, 14542512k available
$swap -l
swapfile dev swaplo... (6 Replies)
Discussion started by: seenuvasan1985
6 Replies
10. AIX
Please take your time to answer/comment. no urgency. it would help upcoming sysadmins like me in understanding how things work in real time.
OS: AIX
Middleware: Weblogic/WAS
Database: Oracle DB/IBM DB2
Backup s/w tools: not available as of now (except native OS commands/utilities)
I'm a... (5 Replies)
Discussion started by: aaron8667
5 Replies
LEARN ABOUT DEBIAN
sg_get_swap_stats
sg_get_mem_stats(3) Library Functions Manual sg_get_mem_stats(3)
NAME
sg_get_mem_stats, sg_get_swap_stats - get VM statistics
SYNOPSIS
#include <statgrab.h>
sg_mem_stats *sg_get_mem_stats(void);
sg_swap_stats *sg_get_swap_stats(void);
DESCRIPTION
Memory statistics are accessed through the sg_get_mem_stats function. It returns a pointer to a static sg_mem_stats.
The sg_get_swap_stats returns returns swap statistics. It returns a pointer to a static sg_swap_stats.
On the FreeBSD operating system elevated privileges are required to access the swap statistics. Making the program setgid kmem should be
sufficient. Programs running as root will not have this problem.
RETURN VALUES
The VM system calls can return a pointer to either a sg_mem_stats or a sg_swap_stats.
typedef struct{
long long total;
long long free;
long long used;
long long cache;
}sg_mem_stats;
total The total amount of memory in bytes.
free The total free memory in bytes.
used The total used memory in bytes.
cache The amount of cache used in bytes.
typedef struct{
long long total;
long long used;
long long free;
}sg_swap_stats;
total The total swap space in bytes.
used The used swap in bytes.
free The free swap in bytes.
TODO
Add a function to hold open the file descriptor to the kernel memory structures. Doing this would allow the elevated privileges to be
dropped early on.
SEE ALSO
statgrab(3)
WEBSITE
http://www.i-scream.org/libstatgrab/
i-scream $Date: 2005/04/25 11:25:45 $ sg_get_mem_stats(3)