Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identifying process memory usage 3

Status
Not open for further replies.

dklloyd

MIS
Mar 9, 2001
78
GB
I need to reduce the amount we are currently paging memory. To this end, I need to identify how much memory each process is using and if possible whether it is using real memory or is paged out.
'top' give the sort of info I need to start with but doesn't list all processes. What command(s) can I use to achieve this?

Thanks in advance for any info you can supply!

dklloyd
 
# ps auxww

fourth field, shows the % of real memory that the process is using.

crowe
 
The short answer is to alter the settings of minperm and maxperm - decrease the former, increase the latter. This can be done using vmtune (/usr/samples/kernel).

How much to decrease / increase is best ascertained through experimentation, but it's probably worth understanding what minperm and maxperm do (apologies if you know all this, but someone else reading this may not) :)

Data is essentially held in pages of 4096b, and a page in RAM is accessible by the CPU, if the page is on disk the CPU can't access it directly.

A page fault occurs when a wanted page address does not translate to a real memory address. At this point the Virtual Memory Manager (VMM)knows it needs to get data from disk and place it in RAM - it therefore checks to see that there is space in RAM in which to out this data.

If there's enough room, VMM checks to see if the wanted page has been used previously by this process:

- if not, an "initial page fault", VMM allocates _two_ pages for the data; one in RAM and the other on a backing page on disk where it can go if it has to be temporarily removed from RAM.

- if it has, a "repage fault" I/O is scheduled to bring the data back from disk and into RAM - the act of resolving this repage fault is called a "page-in" (the process that is waiting for this to happen is in a "page wait state").

So what happens if there's not enough room in RAM to put the page? Well the page stealer is there to ensure that there is a supply of free RAM pages available for an initial page fault. If the number of free RAM pages drops below a specified value (minperm) then the page stealer will try and get some pages back. It keeps on stealing pages until it reaches an upper limit (maxperm).

So how does it decide which pages to steal? The page stealer will select the least recently used, or LRU, pages. If the page has been modified in RAM it's classed as a dirty page and is put to a backing store (either page space or a filesystem); if it's clean (the copy in RAM matches the copy in page space) then the RAM page is purged.

Note that the page space is used for non-persistent or working pages, and the filesystem is used for persistent or file pages.

Hope it helps.
Dave V.
 
I've just noticed what I have written - ignore the first line... decrease BOTH values of minperm and maxperm.

Cheers.
 
dklloyd, install the performance related tools and use [tt]svmon[/tt] to inspect your processes. [tt]ps[/tt] is extremely inexact at the figures and percents it shows.
I hope it works...
Unix was made by and for smart people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top