# Managing Swap  Size



## HackWolf (Nov 10, 2010)

Hi  all   i wonder that  what is arraning, managing  swap  size...

Today  i need   to resize Swap size but  didnot  fount  anyting about that..

My swap size is this. Already Mounted.

```
Device          1K-blocks     Used    Avail Capacity
/dev/ad14s1b      4194304        0  4194304     0%
```

Before

```
CPU: 41.5% user,  0.0% nice, 19.7% system,  1.3% interrupt, 37.5% idle
[color="Red"]Mem: 3110M [/color]Active, 4262M Inact, 185M Wired, 210M Cache, 112M Buf, 236M Free
Swap: 4096M Total, 4096M Free
```

After

```
CPU: 41.5% user,  0.0% nice, 19.7% system,  1.3% interrupt, 37.5% idle
[color="Red"]Mem: 3110M Active[/color], 4262M Inact, 185M Wired, 210M Cache, 112M Buf, [color="Red"]2236M Free[/color]
[color="Red"]Swap: 2048M Total, 2048M Free
```
[/color]


What should i do for resizeing swap space?


----------



## AndyUKG (Nov 11, 2010)

Your question and the info you posted doesnt seem very clear to me.
The info posted shows that you had 4GB swap and have reduced it to 2GB, and also shows that the swap devices is 4GB (but doesnt say if this is before or after).

What exactly did you do, what are you trying to achieve? Does the output of swapinfo match the current size of your swap device?

thanks Andy.


----------



## HackWolf (Nov 11, 2010)

When  i type `top`  swap size is this 
	
	



```
Swap: 4096M Total, 4096M Free
```
  But I use only 2048 swap size. How  can I arrenge this any  way?

You  see  my real 
	
	



```
Mem: 3110M Active, 4262M Inac
```
  I need  real memory  4x2G   Ram slot I got  Mother bord  dont supoort 4x4G ram.



```
CPU: 48.7% user,  0.0% nice, 22.4% system,  1.5% interrupt, 27.4% idle
Mem: 3170M Active, 4169M Inact, 235M Wired, 92M Cache, 112M Buf, 337M Free
Swap: 4096M Total, 4096M Free
```


----------



## SirDice (Nov 11, 2010)

The "before" top output shows a total of 8GB of RAM. The "after" top output shows a total of 10GB of RAM.

The numbers don't add up.


----------



## HackWolf (Nov 11, 2010)

hÄ±mm any  clue?  for the  swap size how  you manage this.

Ä°f  i use 2048 Swap  size  i thing my  real memory  grow up  6G Ram so Free space will be greater then this  value now  i  only have 273 free space when show under 200  system  panics.


----------



## Alt (Nov 11, 2010)

HackWolf
1) Your swap size will NOT be added to real memory. Because it is not normal. Swap is different thing than RAM.
2) Its nothing bad when you have only 273 free ram. Most of RAM used for buffers, cache etc. And will be freed when OS will need this memory for programs.


----------



## graudeejs (Nov 11, 2010)

OP wants to shrink his swap by half


----------



## SirDice (Nov 11, 2010)

HackWolf said:
			
		

> Ä°f  i use 2048 Swap  size  i thing my  real memory  grow up  6G Ram so Free space will be greater then this  value now  i  only have 273 free space when show under 200  system  panics.


No, the Mem: bit in top only shows REAL memory aka RAM. It does not include virtual memory.


----------



## HackWolf (Nov 11, 2010)

dont have enoufh documantation  about Bsd. i m  going to change pc


----------



## jalla (Nov 11, 2010)

killasmurf86 said:
			
		

> OP wants to shrink his swap by half



Not only that. He wants to take 2G from swap and add to (physical) free memory.
(*Before* is the current state, *After* is what he's looking to accomplish).


----------



## jalla (Nov 11, 2010)

HackWolf said:
			
		

> dont have enoufh documantation  about Bsd. i m  going to change pc



If you mean a change of OS, yeah, you might as well.
Good luck whatever platform you choose.


----------



## DutchDaemon (Nov 11, 2010)

It really is too bad that there's not enough documentation about BSD. Also, that there's so little water in the oceans.


----------

