Re: whats in swap? why am i using all of it?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eli...

> I've got a couple nodes (running inside VM on a s390) that are using
> up every bit of there swap, yet only using a 1/3 to 1/2 there memory
> (-buffers/cache).

Geez, you have s390? Can you give me a free SSH account? :) I heard 
virtualization on s390 is ancient but one of the best in the world :)

> Here is free -m from a node:
> $ free -m
>              total       used       free     shared    buffers    
> cached Mem:          1008       1002          5          0         98
>        514 -/+ buffers/cache:        390        618
> Swap:           99         93          6

Hm, so actually page cache is around 98+514=  612 MB. Quite big, but 
surely it helps relieving I/O pressure in some cases...

> So out of 1008MB total memory we're only using 390, Not to bad. But
> it does seem kinda bad when you look at it as you have 514MB in cache
> but your almost out of swap.

well, usually people allocate swap bigger than the available RAM, but 
this rule is somewhat "informal"...

> This leads to my 2 questions.
> 1 Why am i using any swap when i have so much memory free?  (and is
> that a problem, if so would adding more memory even help? How about
> more swap?)

Actually, from kernel point of view, you have low free RAM. Somehow you 
need to make the kernel dedicate lesser portion of RAM for page cache. 
Too bad I can't find one, but the closest I can find is 
/proc/sys/vm/vfs_cache_pressure. read 
Documentation/filesystems/proc.txt for further explanations.

> 2 How do i tell whats in swap anyway. like a lot of memory management
> stuff there doesn't seem to be a easy way to tell.

Possibly it contains lots of swapped-out anonymous pages. For fun, try 
something like:
strings -t x /dev/<your swap device> | head -30
and see in case you see your shell history there :)

regards

Mulyadi


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux