Blogs

About this blog

AIXpert Blog is about the AIX operating system from IBM running on POWER based machines called Power Systems and software related to it like IBM Systems Director, PowerVM for virtualisation and PowerSC for security plus performance monitoring and nmon

Links

Tags

Recent tweets

AIX Memory Usage - or - Who is using the memory and how?

Common question: I see XX% of Used Memory but I don't know who is using it and how?

A simple question but there is no simple answer as memory use if complex.

nmon then hit "m" will quickly show you a few big uses of memory as below:

The shared memory used by lots of applications like DB2 and Oracle - check the SEGSZ for the size.
The Owner column usually tells you what it is used for like the oracle user for the SGA or db2inst1 for the DB2 buffer cache.

Then it is down to the processes and this gets tricky.

All processes running the same program file will be sharing the code pages as its read-only.
The may also be sharing some or nearly all of the data and sack pages if the processes started by a common process that then forked like for example RDBMS and things like Apache.
This is also true for the dozens of libraries that processes also need and are largely invisible to us.

Due to this unknown sharing it is often the case if you add up all the memory of all the processes it is obviously much larger than memory.

If you use nmon then "t" for top processes and then "4" to order in process size you see the process memory

Size KB = the size as found in the program file on disk.

Resident Set Size = how big it is in memory (excluding the pages still in the file system (like code) and some parts on paging disks)".

ResText column is the code pages of the Resident Set

ResData column is the data and stack pages of the Resident Set

If you want the full details then you need the svmon command but be warned - this tells you the full picture and it is very complicated. Even when listing the details of a single process - as you find there are a dozen combinations of memory attributes and you find you processes memory has all of them and for the dozen libraries.