Oracle Memory usage on AIX

A process memory can be divided into 2 parts:

  • user data (including Variables, dynamically allocated data, function parameters and return values etc), that is unique to each process;
  • program data (as known as Text, program itself, shared libraries etc), can be loaded once into memory and linked as shared library to many processes, e.g. $ORACLE_HOME/bin/oracle, that’s a big code; it usually takes 90% of a process memory size.

Usually ps -l shows memory used by a process, it doesn’t distinguish user data (unique to this process) and program data (shared among many others), it simply over reports memory usage if we make a sum of total memory usage by all processes.

$ ps -ef |grep pmon
gltoracl  667692       1   0   Apr 05      -  5:46 ora_pmon_GOLDTEST

$ ps -lef |head -1; ps -lef |grep 667692 |grep -v grep
F S      UID     PID    PPID   C PRI NI ADDR    SZ    WCHAN    STIME    TTY  TIME CMD
240001 A gltoracl  667692       1   0  60 20 aff56590 99112            Apr 05      -  5:46 ora_pmon_GOLDTEST

ps v <PID> gives a more precise report

$ ps v 667692
PID    TTY STAT  TIME PGIN  SIZE   RSS   LIM  TSIZ   TRS %CPU %MEM COMMAND
667692      - A     5:46   21  8372 137012    xx 90741 129896  0.0  2.0 ora_pmo

as you see, the SIZE=8372 KBytes repoted by ‘ps v’ is much less than SZ=99112 KBytes reported by ‘ps -l’.

where:

  • The SIZE is Virtual Memory used by user data of this process. Virtual Memory = Physical Memory + Memory in paging space.
  • RSS (=137012 KBytes) reports Physical Memory used by both user data and program data.
  • TRS (=129896 KBytes) reports Physical Memory used by program data (the shared part)
  • RSS-TRS(=7116 KBytes) reports Physical Memory used by user data.
  • SIZE – 7166(=1256 KBytes) = Size of Paging space used by user data.

svmon -P can give more details on memory usage


$ svmon -P 667692 -O filtercat=exclusive -O filterprop=data
Unit: page
-------------------------------------------------------------------------------
Pid Command          Inuse      Pin     Pgsp  Virtual 64-bit Mthrd  16MB
667692 oracle            1779       48      310     2093      Y     N     N

Where

  • Virtual(=2093 pages) represents Virtual Memory used by user data of the process. It matches 2093*4K=8372 KBytes = SIZE as reported by ‘ps v’
  • Inuse(=1779 pages) represents Physical Memory used by user data of the process. It matches 1779*4K=7116KB= RSS-TRS
  • Psgp(=310 pages) represents Paging Space used by user data of the process. It *matches 310*4K=1240KB=SIZE-7166.

To list the top ten users of paging space in AIX:

# svmon -Pgt 10

To list the top ten users of real memory in AIX:

# svmon -Put 10

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: