Skip to content


aix process memory consumption – how much does it use?

It is Friday night, and I am back to the americanbulldogrescue.org. We used to have two boxers, one was white and many mistook Kajtek for an american bulldog…. I am looking at the dogs waiting for an adoption trying to come with an excuse I could use to convince my wife. I already tried “this is the best intruder detection “system” which does not a require a backup power supplies ……” – I failed short. She just gave me the look number FIVE!

While I am looking at the available pooches, Adi “reaches and touches” me via the MS Communicator; “Mark, are you there?”. He has some issues with a database server and ask me few questions about memory consumption. “Do you know if DSMC agent really should be using “so and so” memory? Where the “so and so” refers to a specific number expressed in MBs. Well, to be honest I have no idea. So we chat for a few more minutes, I kill some processes and then to make the long story short I offer to reboot this machine which I can do at will since it is not a production one – low level testing server which currently see no usage. Adi agrees and I reboot the host, text him good night and I get out and into my bed.

The question remains, how to establish memory usage of a single process? The most difficult aspect of this question is to remember that the value found is expressed in pages! So if you now the process ID (the number in the second column generated executing ps -ef | grep particular_process_name) you can find its memory consumption like that:

svmon -P 17367068 | more
----------------------------------------------------------------
Pid Command   Inuse      Pin     Pgsp  Virtual 64-bit Mthrd  16MB
17367068 java   440648     9786        0   435928      Y     Y     N

PageSize         Inuse        Pin       Pgsp    Virtual
s    4 KB        31080       1450          0      26360
m   64 KB        25598        521          0      25598

The same could be rephrased or its subject extended to for example – “what are this system the five largest memory consumers”? There are at least two ways to answer this question.

>svmon -Pt5 | perl -e 'while(<>){print if($.==2||$&&&!$s++);$.=0 if(/^-+$/)}'
----------------------------------------------------------------
Pid Command   Inuse      Pin     Pgsp  Virtual 64-bit Mthrd  16MB
17367068 java  442000  9786      0   435928      Y     Y     N
13893728 java  423720  9663      0   417884      Y     Y     N
17957084 java  383216  9220      0   379021      Y     Y     N
10158108 java  219702  8445      0   218189      Y     Y     N
15990974 kulagent 215901  8380   0    44549      Y     Y     N

Yes, I do not use the previous command as I am old and my memory is not what is used to be….. I use this instead.

svmon -Pt5 | grep -p Pid
-----------------------------------------------------------------
Pid Command   Inuse      Pin     Pgsp  Virtual 64-bit Mthrd  16MB
17367068 java 441251  9786        0   435927      Y     Y     N

-----------------------------------------------------------------
Pid Command   Inuse      Pin     Pgsp  Virtual 64-bit Mthrd  16MB
13893728 java 422329  9663        0   417884      Y     Y     N

-----------------------------------------------------------------
Pid Command   Inuse      Pin     Pgsp  Virtual 64-bit Mthrd  16MB
17957084 java 384788  9220        0   379021      Y     Y     N

-----------------------------------------------------------------
Pid Command   Inuse      Pin  Pgsp  Virtual 64-bit Mthrd  16MB
10158108 java 219710 8445        0   218189      Y     Y     N

------------------------------------------------------------------
Pid Command   Inuse      Pin  Pgsp  Virtual 64-bit Mthrd  16MB
15990974 kulagent  215932 8380        0    44549      Y     Y     N

The output is not as compact but at least the command is easy to remember. If you know about the other ways and you feel like doing so, please left a comment.
By the way, if you are interested in finding the five top most users of your host paging space, execute svmon -Pgt 5.

UPDATE:

In one of the comments, ironman suggested using the memdetails.sh script that is part of the perfpmr package (free downloads from ftp.software.ibm.com) and/or the workload manager to accurately defined the amount of memory used. I downloaded and executed the script and and the amount of information its generates left me speechless and scratching my head – I do not think it can be used to list usage of a specific process. On the other hand, I am about to believe that ironman’s second suggestion is more of what I am looking for and need. You may start learning about workloads (if you are like me and are new to workloads) reading Nigel Griffith’s presentation titled “Setting up AIX Workload Manager in 30 minutes“. There is also a RedBook wholly dedicated to this subject titled “AIX 5L Workload Manager (WLM)”.

Posted in Real life AIX.


9 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Sebastian says

    Hi,
    Thanks for the information, I suggest a more redable format when you use:
    svmon -P -t 5 -O unit=auto
    Stange thing is that command does not work on AIX 5.3 (maybe too old) and with
    svmon -P -g -t 5 -O unit=auto it does not work on any OS. But I think the first Command is worth an alias on my systems. Thanks for the hint…

  2. iulianr says

    I don’t think it is as accurate as it seems to be, specially when you have multiple processes which use the same shared memory segment.

  3. Sebastian says

    After trying this command on various systems I have, I wish there was a field whitch shows if “inuse” is shared memory and how much of them is shared. I have a lot of Oracle DBs where much shared mem is used. Shared memory “blurrys” the mapping of the real used memory a lot. So memory in AIX is still stays a “book with seven seals” for me 😉
    Cheers Sebastian

  4. MarkD:-) says

    at least it can deliver an idea of “how much is being used” at the given moment…

  5. MarkD:-) says

    the “seven seals” indeed 🙂

  6. iulianr says

    there are 2 methods you can use to get an accurate enough memory usage in AIX:

    – memdetails.sh script in perfpmr
    – define classes in workload manager

  7. Sebastian says

    Hi Mark,
    I don’t know if you know this article from the developperworks site:
    http://www.ibm.com/developerworks/wikis/display/WikiPtype/memuse.utils
    A nice script for getting all the memory details from your environment and ironically needs a huge amount of ram to use 😉
    Cheers Sebastian

  8. MarkD:-) says

    Sebastian,
    thanks for the link!

    MarkD 🙂

  9. MarkD:-) says

    Well, ironman look what you have just done – you made me look and learn something new (workload manager….. brrrrrr).

    Thanks,

    MarkD 🙂



Some HTML is OK

or, reply to this post via trackback.

WordPress Anti Spam by WP-SpamShield



Copyright © 2016 - 2017 Waldemar Mark Duszyk. All Rights Reserved. Created by Blog Copyright.