DBA - Wiki

AskDBA.org Forum » DBA - Wiki

Monitoring top 10 memory consuming process on AIX (1 post)

About This Topic

Tags

  1. Amit Bansal

    Oracle DBA
    Joined: Jun '08
    Posts: 73

    offline

    Posted 2 years ago
    #

    At times, you wish to find the processes with maximum memory consumption. This can be easily done using following command. Copy contents in file and run it like as vmstat command

    ### Usage mem_mon.sh (interval) (occurences) e.g sh mem_mon.sh 2 10 ###
    ### This will give top 10 memory consuming processes #####
    wt_time=$1
    lmt=$2
     let a=0
    while [[ $a -lt $lmt ]] ; do
    ps axwv |sort -nrk 7,7|grep -v "COMMAND" \
    |awk 'BEGIN {printf ("MemoryinKb \t ProcessId \t PerCPU \t PerMem \t Command \n")}{t=t+$7 - $10 ;printf("%13d \t %10d \t %6.2f \t %6.2f \t %s \n",$7 - $10,$1,$11,$12,$13)}END{print t}'|head -10
     let      a+=1
    sleep $wt_time
    done
    

Reply

You must log in to post.

AskDBA.org Forum » DBA - Wiki
251 posts in 104 topics over 45 months by 63 of 109 members. Latest: KNHarri, xiaoling, Williams29