Getting memory size for an application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shorti

    Getting memory size for an application

    Hello, I am running DB2 V8.2 on AIX. I am looking for a way to get
    the memory size of a specific db2 agent. I have found the db2mtrk
    tool that gives me a list of all the applications and heap sizes.
    Also there is "DB2 Snapshot for Application" but I am looking for a
    way to capture the data for C code without having to parse through a
    file. The SNAPSHOT_APPL and SNAPSHOT_APPL_I NFO table functions seem
    to fall short of the information

    I noted there is an admin view available in DB2 V9 that gets the same
    information as db2mtrk but it does not appear to be available in V8.

    So, does anyone know of a way to retrieve this data? Is it stored in
    a DB2 System table somewhere or is there some other way to access the
    info from memory? Maybe there is a nifty way to extract it from
    SNAPSHOT without outputting to a file and parsing it. I have looked
    at getting the same info from AIX but it would also require gathering
    the size from a "ps" file or the like....and that is after I match the
    application id to a PID.

    I am looking for a "low cost" way of doing this as I do not want to
    tax the system in any way to get the data. Any advise would be
    helpful.

    Thanks in advanced!
  • Lew

    #2
    Re: Getting memory size for an application

    Since a db2 agent is just a process in v8 you can use the ps aux
    command, SZ and RSS columns, to estimate the process size. If you
    have root authority you can use svmon for detailed memory usage.

    Lew

    Comment

    • shorti

      #3
      Re: Getting memory size for an application

      On Jun 19, 8:46 am, Lew <seth...@yahoo. comwrote:
      Since a db2 agent is just a process in v8 you can use the ps aux
      command, SZ and RSS columns, to estimate the process size.  If you
      have root authority you can use svmon for detailed memory usage.
      >
      Lew
      Thanks for the response Lew. Ive looked at this and became more
      puzzed at how the sizes co-relate to each other.

      ps aux:

      USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME
      COMMAND
      abcuser 274342 0.0 0.0 4140 2556 - A 15:05:18 0:02
      db2agent (LOCALUSER)

      SZ - size of the core image of the process in 1KB units
      4,140,000
      RSS - real memory size of the process in 1KB units
      2,556,000

      db2mtrk:
      Memory for agent 274342

      Application Control Heap is of size 32768 bytes
      Application Heap is of size 1654784 bytes
      Total: 1687552 bytes


      The SZ and RSS sizes just dont seem to match the memory size according
      to DB2. Also, after comparing many that have the same Application
      Heap size on various machines they dont seem to have the same SZ or
      RSS as I would expect. For instance, machine A and B both had db2
      agents with "Applicatio n Heap" size of 1.7M bytes but the "PS" SIZE
      said 4500 on one machine and 8400 on the other (I am rounding the
      numbers up).

      Comment

      Working...