Monitoring memory usage - looking for memory leaks
 
*
Welcome, Guest. Please login or register. January 09, 2009, 01:48:04 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Monitoring memory usage - looking for memory leaks  (Read 2396 times)
0 Members and 1 Guest are viewing this topic.
Michael
Administrator
Hero Member
*****
Posts: 539


« Reply #6 on: January 20, 2007, 04:58:29 PM »

Computational memory pages are pages of real memory that do not have a
persistent location on disk,                                 
Actually, those are pages are in the working segments. Computional memory is working memory + the .text section (program code) loaded in memory. So a small part of computationla memory does have a location in permanent storage.

Non-computional memory is: "all the rest", and by implication must have a physical refernece in physical storage.
Logged
rbinkl
New Member
*
Posts: 2


« Reply #5 on: January 20, 2007, 03:25:46 PM »

VMM - is the virtual memory manager, a process that is part of the kernel
and is responsible for managing
memory.

Virtual memory is real memory plus disk space (both addresses to data on
disks and paging space)

Non-Computational memory pages are pages of real memory that contain data
that has a persistent location
on disk (executable code of a command, data from a file, etc. not from
data stored in paging space).

Computational memory pages are pages of real memory that do not have a
persistent location on disk, they
are pages of memory needed by a process when it is started and no longer
available when the process
terminates. These are pages in memory that contain things like process
stack and heap, and malloced
space. When memory becomes over committed these pages need to be stored
someplace temporarily
and that is on paging space.
tb steps
 
vmstat -I 2 10                                                         
vmo -a                                                                 
lsps -a                                                                 
svmon -G         

is your swapspace low if so this may help. Defect IY62224 adds a new LRU tunable, lru_file_repage.  This is
on by default, which maintains the current behavior.  The new behavior     
when it is off is that file vs computational repage counts are ignored 
in determining whether to page out only file pages.                     
                                                                       
vmo -p -o lru_file_repage=0  (NO REBOOT NEEDED)                         
This document explains more about lru_poll_interval


I recommend disabling lru_file_repage=0                                 
and sentting lru_poll_interval=10                                       
« Last Edit: January 20, 2007, 03:34:45 PM by rbinkl » Logged
Michael
Administrator
Hero Member
*****
Posts: 539


« Reply #4 on: January 20, 2007, 11:33:11 AM »

Thanks for the scripts.

Just a note though. Since AIX 5.2 the tools in /usr/samples/kernel directory have been replaced by more standardized tools. For example, vmtune has been replaced by vmo (virtual memory options)
Logged
rbinkl
New Member
*
Posts: 2


« Reply #3 on: January 19, 2007, 11:48:12 PM »

#!/usr/bin/ksh
# Robert BInkley
#Collect vmstat and ps to detect memory leak
# Version History
# 07/24/02: Split perf data into separate files
#LOGDIR=/tmp/rob ## Change to use in your enviorment
#LOGDIR=/system/perf/robi
if [ ! -d $LOGDIR ]
then
mkdir -p $LOGDIR
fi
HN=`hostname`
DATE=`date +"%y.%m.%d.%H.%M"`
ps -ef> $LOGDIR/$HN.$DATE.ps
while true
do
(     
date
vmstat 5 3
echo
#ps vg
#echo
lsps -a
echo
iostat -d 5 2|egrep "hdisk0|power"
echo
) >>$LOGDIR/$HN.$DATE.perf 2>&1

#SVMON

(
date
/usr/bin/svmon

/usr/bin/svmon -Pt 5|grep -ip "pid"
echo
) >> $LOGDIR/$HN.$DATE.svmon 2>&1

#FILEMON

date >>$LOGDIR/$HN.$DATE.filemon
(
date
filemon -Opv,lv
sleep 240
trcstop
echo
) > $LOGDIR/$HN.filemon.tmp 2>&1

#VMTUNE
(
date
/usr/samples/kernel/vmtune
echo
) >> $LOGDIR/$HN.$DATE.vmtune 2>&1
sleep 10
grep -ip "Most Active" $LOGDIR/$HN.filemon.tmp
>>$LOGDIR/$HN.$DATE.filemon
echo >>$LOGDIR/$HN.$DATE.filemon
done &

Logged
Michael
Administrator
Hero Member
*****
Posts: 539


« Reply #2 on: November 09, 2006, 09:32:09 AM »

  • svmon is a command with many options - and that makes it difficult to use initially.
  • ps may be suitable, but only if your application is not sharing memory with several processes as all memory gets lumped together over all processes using the memory
  • One option to start with, rather than -P, is -C command which limits output to a single command, or list of commands (more than one command can be listed). Further, there are extra options to limit display to shared, exclusive, and/or kernel/non-kernel memory (i.e. user space, "system" related space).

    As you are looking for a possible memory leak, the pattern you are looking for is a stable inuse amount, with a regularly increasing  Virtual amount
    Logged
    TestUser
    Jr. Member
    **
    Posts: 7


    « Reply #1 on: November 09, 2006, 09:22:47 AM »

    Well, one quick and dirty method would be:

    ps -e -o pid,vsz,args

    This would give a formatted output of the PID, the virtual size of the process in kbytes, and the command line. The memory calculations that the ps command use aren't all that accurate. But it should work to identify a growing process.

    Another command is:

    ps gv

    Look for the RSS column. This is the resident set size (real memory usage) of the process in kbytes.

    Still, the svmon command gives the most accurate picture of memory use.
    Logged
    TestUser
    Jr. Member
    **
    Posts: 7


    « on: November 09, 2006, 09:22:03 AM »

    Is there an easier way to find a list of process's by process ID# and amount of memory the process is using instead of doing it the following way:

    "svmon -Pu" and then finding the process in the list and calculating the "in use" column divided by 256 for megabyte calcuation?

    For example
    The memory usage for the ent processes (example below) has increased from 28700 4k pages (112MB) to 116508 4k pages (455MB).

    svmon -Pu
    Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB
    254182 ent 28700 7546 0 14941 N N N

    Would be 28700 / 256 = 455 megabytes.

    I am just looking for possible memory leaks on my HMC dual P570's running 5.3 rl3 on 8 processors with 8 gigs of ram (10 gigs total including virtual). Building a log file over time gets very populated with information when I just wanted to montior process's by process id # and converting the "in use" 4k pages into megabytes.
    Logged
    Pages: [1]   Go Up
      Print  
     
    Jump to:  

    Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC

    Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
    Page created in 0.958 seconds with 18 queries.




    eXTReMe Tracker

    Terms of Use and Privacy and Security Policies
    Copyright 2001-2008 Michael Felt and ROOTVG.NET