cancel
Showing results for
Did you mean:

SOLVED
Go to solution

## swap calculation

HI all,

I want to know how to calculate total swap space currently assigned in my system. shall i add (12240+15008)=27248Mb?

# swapinfo -tam
Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev       12240    1546   10694   13%       0       -    1  /dev/vg00/lvol2
dev       15008    1543   13465   10%       0       -    1  /dev/vg00/lvol10
reserve       -   19761  -19761
memory    32737    5842   26895   18%
total     59985   28692   31293   48%       -       0    -
#

Total physical memory is 32GB

# machinfo|grep -i memory
Memory = 32736 MB (31.968750 GB)
#

Regards,

A

Regards,
Ani
4 REPLIES
Acclaimed Contributor
Solution

## Re: swap calculation

>I want to know how to calculate total swap space

Why?  The value is printed on the total line:

total     59985   28692   31293   48%

There is no need to know how it is calculated, it's just there.  :-)

It's the sum of the values in the second column.  The memory row is pseudo-swap which no ordinary mortal can compute.

## Re: swap calculation

HI,

I want to understand this . For our servers i need to check the ratio of swap memory & physical memory.

Total : -is showing swap+real memory right?

if i need to calculate how much swap space is allocated in my system then shall i add the "dev" value showing on swapinfo o/p?

if so then as per above o/p my swap memory is (12240 + 15008)=  27248 ?

total:27248 (swap) + 32736 (real)=599984 ?

please let me know if i am wrong...

Regards,
Ani
Acclaimed Contributor

## Re: swap calculation

>Total: is showing swap+real memory right?

No.  Total is device swap plus pseudo-swap.  Where the formula for computing the latter is too complex to understand and changes on OS versions.

As you saw above, on 11.31, it "seems" pretty close to memory size but I've heard of numbers like 7/8 or 3/4 for previous OS releases.