- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to determine what is causing a memory leak?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 02:16 AM
11-17-2003 02:16 AM
Mgmt Svr: HP-UX 11.0 VPO 6.14 NNM 6.2 Oracle 8.1.7.2 MC/SG 11.09 Two node cluster running OVO 6.14. Each L2000 server has 4GB of memory.
We believe we have a memory leak on our system.
We added 2GB of additional memory 9 days ago.
A 'vmstat 5' consistently showed 800MB in the "free" column.
Now (9 days later) a 'vmstat 5' shows only 80MB of "free" memory.
Question, How do we determine what is causing the memory leak?
10 points to any good answer.
Thank you
Gino
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 02:22 AM
11-17-2003 02:22 AM
SolutionI've used the output from the 'ps -el' command to track the size of a program in memory. The tricky part is first to identify the program with the potential memory leak, but if your memory is mostly gone now it will probably be one of the processes using the most memory right now.
You can do this:
ps -el | sort -nr -k10 | head
to see the processes using the most memory. Once you have a likely candidate, you can track it with 'ps -lp #####' where ##### is the PID of the suspect process. I just put that command in a little shell script loop with a sleep and dumped the output to a file. I used this method once to find a memory leak in an Oracle web program.
Have fun!
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 02:23 AM
11-17-2003 02:23 AM
Re: How to determine what is causing a memory leak?
A quick search for "memory leak" turned up tons of threads, among them:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=92268
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=92323
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 02:23 AM
11-17-2003 02:23 AM
Re: How to determine what is causing a memory leak?
UNIX95= ps -eopid,vsz,user,args |sort -rnk2
You get the PID, the memory use in KB of a process, the owner and the command (with available arguments), sorted to display the processes using the most memory first.
Running this at intervals will allow you to see which processes are consuming memory. You can then look for patches (from HP or your application vendor) to address the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 02:23 AM
11-17-2003 02:23 AM
Re: How to determine what is causing a memory leak?
1. ensure its not the OS. Do this by ensuring that dbc_mac_pct is set to a hard value (not too big - around 400MB is sufficient) and vx_ninode is not set to 0 - set it to a value.
2. reboot server. dont start any apps. check how much free memory using vmstat (free line is free mem in pages, multiply by 4096 for size in bytes)
3. start an app. check free memory so you can see how much it is using. shutdown app, free memory total should go back to what it was before you started app.
4. continue with each app in turn, only starting and stopping one at a time. If free memory does not return to the same level after youve shutdown an app then it has a memory leak.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 02:26 AM
11-17-2003 02:26 AM
Re: How to determine what is causing a memory leak?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 02:28 AM
11-17-2003 02:28 AM
Re: How to determine what is causing a memory leak?
e.g.
date >> /var/tmp/ps.log
UNIX95= ps -e -o vsz,pid,comm >> /var/tmp/ps.log
echo "" >> /var/tmp/ps.log
The first column is the size in KB of the process. You then write a script to extract the entries by pid and note the one that grow over time --- those will be the 'leaker's'. Note: It is perfectly normal for some processes to grow over time as more and more data is cached --- it all depends upon how the program was written and what the programmers intent was. You should also do ipcs -m's over time and see if the number/size of shared memory segments grows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2003 02:31 AM
11-17-2003 02:31 AM
Re: How to determine what is causing a memory leak?
Solution: If your instance is leaning towards more DSS/DW type -- employ direct IO on your VxFS Filesystems (,mincache=direct,delaylog,convosync=direct). And limit disable dynamic caching and limit it to between 5%-10% of total memory (dbc_max_pct = dbc_min_pct ~ 5-to-10%)