As promised, here is the second part of the answer:
In the following, when not stated explicitly otherwise, the unit we measure in are memory pages, which is 4K (4096 bytes) in the overwhelming majority of cases. There is the option of using "large pages" (16MB) but i have yet to these used in reality.
I said above that memory is used for programs and what isn't used for programs is used for buffers. IBM calls that computational memory (the part which is given to running processes) and file memory (the part used for file caching). It is obvious that with the constant loading and unloading of processes the memory is given back and forth as the current amount of used memory changes. Also notice that there is "pinned memory". That is memory which is allocated in a way that it can't ever be swapped out. I gave you already one example - shared memory - but there are other types of pinned memory too.
So, at a given moment, save for this pinned memory, we have a memory that is to some part computational memory and (nearly) all the rest is given to file memory. The not pinned memory is constantly scanned for possible candidates to either swap out or to add to either file or computational memory. There is a special process for this, the "lrud" (least recently used daemon). Pages which could be used for file or computational memory (basically the memory that could be swapped) are called "lruable" (notice that all these words are IBM speak, you will find these terms in the output of various programs).
Now suppose we have a system that is running at capacity limit (all other cases are rather trivial): the kernel now has to decide at any given point, what to do: either shrink the file memory or swap some programs out. At first, as ever more memory is demanded, it makes sense to shrink the file cache. At a certain point read/write operations would suffer so much from a further reduction of this cache that it might be overall better to swap something out and back in later. The procedure is called "page stealing" because memory pages which are in use are "stolen" and put to another use. What the kernel does under which circumstance is controlled by the tuning parameters minperm and maxperm. Both these values are percentages.
When the percentage of memory holding file pages falls below minperm, needed memory will come from both file and computational memory. Processes might get swapped out (stealing from computational memory) to avoid reducing the file memory any more. Again, which specific pages are stolen will be determined by the lrud.
When the percentage of memory holding file pages is between minperm and maxperm only file pages get stolen. Processes that are starting get their memory by the kernel diminishing the file memory and giving the so freed memory to them.
This way you can control the decisions a kernel will take under certain circumstances.
You haven't posted any vmstat-output yet, so i take one from the IBM site:
First things first:
We have ~1Mio memory pages, which is 4096*1Mio=4G of real memory. Of these about 936k pages are eligible to be scanned by the lru-daemon.
maxperm is at 90%, minperm is at 3%. (This is a setting typical for databases, which do not need the file cache for their operations and in fact bypass it.) Right now 52533 pages (~ 200MB) are used for the file cache, which is ~5.6% ("numperm") of the memory: Also 29.8% of the memory is used by programs ("percentage used for computational pages"). I suppose this machine was started only recently because otherwise the file cache would be bigger. Right now the system doesn't know what to put into cache that makes sense.
Another value that is worth checking is seen when issuing vmstat -vs: "Revolutions of the clock hand". This value shows the number of times the lrud has scanned the whole memory completely for potentially stealable/swappable page candidates. The value itself increases over time and is not interesting as such but interesting is the growth rate of the value. The faster it grows the faster the memory is scanned - to put it in dramatic terms: the more frantic the system is searching for freeable memory. If the system searches frantically there must be some pinch it is in, yes? This way you can anticipate the development of a memory shortage even before the system starts really swapping. Of course the numperm and number of computational pages add to this picture but it is always a good idea to take pictures from different sides and look if all adds up from every side.
OK, here i end. There is a lot more to say about each of these things but, again, if you are really interested, you should take a class or two and you might also search our forum for the terms you now should be familiar with. Several people have written valuable info about these things over time and you can learn from others perhaps more than from me. If you still have specific questions you can also ask, we are glad to help - just don't expect every answer to be as long as this one.
You might want to read my performance tuning introduction for more general information about the concepts and tools involved in performance monitoring and tuning.
Hi All,
I have a question, can you guys please help me by giving your valuable suggestons:
I am using AIX 5L, running oracle 7 version. I need to increase the oracle memory to 40 MB more. Currently Oracle occupies 260M. I wanted to know whether I can increase the memory without any problem.... (1 Reply)
Hi All,
I have a question, can you guys please help me by giving your valuable suggestons:
I am using AIX 5L, running oracle 7 version. I need to increase the oracle memory to 40 MB more. Currently Oracle occupies 260M. I wanted to know whether I can increase the memory without any problem.... (3 Replies)
Hi,
We have AIX 5.1 machine of RAM 8 GB and paging space is 8GB. we are getting high memory usage of almost 99%.Can anybody please help in this ?
Partial vmstat o/p
kthr memory
----- -----------
r b avm fre
2 1 278727 1143
There is no paging issue.Becoz in... (5 Replies)
Hi Guys,
I wonder what would be the best way to determine how much memory is in use on any given time by the database processes. I thought about using ipcs -m command but I wonder if there any better way to determine this. Thanks.
Harby. (2 Replies)
Hi,
I have AIX 5.3TL8 two node cluster using HACMP and have 10g database using RAW devices. I am seeing gradual increase in comp% memory everyday and it reaches 100% and evicts the node, we had 4 evictions in 40days.
I am pasting vmstat and vmo output, anyone seen this issue?
... (5 Replies)
Hi All,
Anyone has script to monitor AIX total processes memory and cpu usage that contribute to the total memory and CPU utilize so far ?
The purpose of this is to analyze process memory trend.
Thanks.
Best Regards,
ckwan (2 Replies)
Hi All,
I have some questions regarding the performance, MEMORY/ Virtual Memory (paging /swap space)
Please see the nmon-MEMORY stats from my AIX LPAR.
24 GB --> RAM
3456 MB --> Paging Space
│ Memory ───────────────────────────────────────────────────────────────────────
│... (8 Replies)