1834089 Members
2268 Online
110063 Solutions
New Discussion

actual device swap usage

 
SOLVED
Go to solution
Michael Dalanek
Advisor

actual device swap usage

Is there any way to see the actual device swap usage (reserved) ?

swapinfo always shows 0% used (unless your paging or out of memory in which case its >0), but for all user processes loaded into memory they must reserve some device swap and I want to see how much is reserved. Even glance/gpm does not show this.
4 REPLIES 4
Stefan Farrelly
Honored Contributor
Solution

Re: actual device swap usage


Yes, this is a problem. It would be nice to see actually how much reserved device swap is in use (which shows all programs loaded into memory which arent locked - ie. eligible for actual paging to disk if necessary). The only way ive found to do it is with a C program. Its attached, called memory_detail.c
The output looks like this once youve compiled and run;


Memory Stat total used avail %used
physical 512.0 267.9 244.1 52%
active virtual 34.8 19.0 15.8 55%
active real 38.9 15.6 23.4 40%
memory swap 376.0 142.1 233.9 38%
device swap 512.0 70.5 441.5 14%

This is extremely handy. Now you can see from above I have 70.5 MB of processes loaded into memory which are not locked into memory (like Oracle would be eg.) and eligible for paging to disk if I run out of physical memory.
Memory swap shows me I have 142MB of ram used which is locked - ie. it cant be paged. This includes things like buffer cache, the kernel and its tables, and specific OS daemons which cant be paged out.

Im from Palmerston North, New Zealand, but somehow ended up in London...
SURI  HUNJAN
Advisor

Re: actual device swap usage

Hi michael,

try swapinfo -t.
Normally gives a percentage of total swapspace reserved.

cheers
surinder
MANOJ SRIVASTAVA
Honored Contributor

Re: actual device swap usage

Hi Michael


You may like to use this small script which tell you about memdetails in the following format :

Memory Stat total used avail %used
physical 32764.0 16544.2 16219.8 50%
active virtual 6304.7 2574.3 3730.4 41%
active real 6986.8 2679.0 4307.8 38%
memory swap 26522.5 11651.0 14871.5 44%
device swap 3332.0 3332.0 0.0 100%


I ahve atached a simple script which I got from the forums which can be comiled and run to get this o/p.


Manoj Srivastava


MANOJ SRIVASTAVA
Honored Contributor

Re: actual device swap usage

Hi Michael


You may like to use this small script which tell you about memdetails in the following format :

Memory Stat total used avail %used
physical 32764.0 16544.2 16219.8 50%
active virtual 6304.7 2574.3 3730.4 41%
active real 6986.8 2679.0 4307.8 38%
memory swap 26522.5 11651.0 14871.5 44%
device swap 3332.0 3332.0 0.0 100%


I have atached a simple script which I got from the forums which can be comiled and run to get this o/p.


Manoj Srivastava