Free Memory in aix

Hi,

I want to know how to find out free physical memory in aix,

Try command vmstat

Hi Krishmaths,

Thanks for quick reply, But my requirement is just like in linux and solaris "top" command is there which will display your physical free and used memory and in aix topas command is there but it does'nt show free and used physical memory.

Use "vmstat" and look at the column "fre" in the output. That is the amount of free main memory measured in 4K-pages. You could have found that out by reading the man-page of "vmstat" before disregarding it as unusable for your purpose.

If you want to see a list of processes and how much memory each of them uses try "ps -Alo vsz,pid". The column "vsz" is the amount of memory used. For an in-depth discussion about which other options there are read the man-page of "ps".

bakunin

define "free" ... AIX uses as much memory as it can and so there is only little "unused" memory. E.g. if there is some memory that is not used for program cache AIX uses the rest for file cache. Hence you end up with as little "free" memory as vmstat's "free" column gives. That does not necessarily imply that there is no memory left.... :slight_smile:

This is why i have offered "ps" as a means to find out how much memory is in fact used by processs. Add to this number the shared memory segments and you get a number you can compare to the "fre" column in vmstat. This is the best approximation to whatever you might define as "free". In my wording "free" means "unused" and vice versa, not "maybe freeable by arbitrarily complex procedures". The AIX kernel tries to use memory as efficient as possible and might show relatively little memory as free when it could do with significantly less memory too - that doesn't mean that the number is incorrect, but that maybe processes stay in memory which would otherwise have been swapped out or all sorts of buffers being full-length whereas they would be decreased in size in case of memory shortage.

All this is called "memory management" and is one of the main things a kernel has to do - and as efficiently as possible so. Still, despite all the clever mechanisms IBM might have built into the kernel, for less memory you pay a price and you pay it with performance: the one process might get swapped out but at some point in time you have to swap it in again and then the machine will have to wait for some time. Some buffer size might decrease, but this will - however slightly - affect the hit ratio and certainly not in a positive way.

Bottom line: regardless of how clever you define "free" at last it comes down to "sufficient or not". This is why every performance optimization projects should start with an SLA to agree upon. The user and the SysAdmin have to agree upon how fast exactly is "fast enough". Until then discussions about how free "free" means are pointless.

bakunin

Using "ps" may be a valid means. IMHO svmon (-G) is somewhat better up to this job (how much memory is free) as it keeps away from me some overly complex procedure of summing up every process's memory size to find out how much memory overall is needed. Furthermore there is no need to consider that memory segments can be used by multiple processes when you use svmon. Subtract the (active) "virtual" memory from the "size" and you get a good impression on how much memory is "free"

I agree with the kernel thing - but in case there might have been some misunderstanding: I wasn't up to learn what you, bakunin, understand by "free" memory. I was rather keen to find out what the OP wanted to know in the first place. :smiley: 'Cause I thought this thread was about some AIX specific memory handling which might be confusing for a beginner as there *seems* to be almost no free memory :wink:

svmon -p
ps -efZ
lsps -a
lsps -s
check this

Use topas command.It will be similar to top in Linux

In AIX now you will find that the memory of a system is almost constantly filled to capacity. Even if currently running programs do not consume all available memory, the operating system retains in memory the text pages of programs that ran earlier and the files that they used. There is no cost associated with this retention, because the memory would have been unused anyway. In many cases, the programs or files will be used again, which reduces disk I/O.

If there is a demand on more memory the system will just realocat as required

ALSO you can have a look at NMON

Also, if you look at the AVM column in vmstat output, you get the amount of memory in 4K pages used by processes for their working sets. If this is relatively constant over time, it gives you a pretty good indication of what is really being used for processes, as opposed to file caching. In an LPAR, you can reduce the allocated memory until the system starts to page, then raise it a bit. The AVM column gives you a good place to start with this number. This all assumes a static workload, of course. And databases complicate the matter further.