LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 02-19-2010, 09:38 AM   #1
douglaskbell
LQ Newbie
 
Registered: Feb 2010
Posts: 4

Rep: Reputation: 0
programatically read 'size' shown in top on SunOS?


How can the 'size' of a process shown by 'top', be read programatically in ‘C’ on SunOS?

I'm fixing a memory leak in a large (20,000 lines) ‘C’ program on Solaris.
 
Old 02-19-2010, 10:41 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
It can be found in /proc/<pid>/psinfo.
Look for psinfo in in the proc manual page:
Code:
man -s 4 proc
 
Old 02-19-2010, 12:37 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
DouglasKBell -

Google for "Solaris debug memory leaks" and you'll find several potentially useful tips, including:

UMEM_DEBUG:
http://blogs.sun.com/pnayak/entry/fi...within_solaris

Dtrace:
http://developers.sun.com/solaris/ar...dtrace_cc.html

If this is a commercial project (i.e. if you have a budget, and somebody who can cut a purchase order), I would *definitely* consider getting Purify:

http://www-01.ibm.com/software/awdtools/purify/

'Hope that helps .. PSM
 
Old 02-20-2010, 06:05 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
To track down memory leaks, you can also use Sun Studio dbx rtc extension.

http://docs.sun.com/app/docs/doc/819-5257/blahb?a=view
http://developers.sun.com/sunstudio/downloads/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] top: select the shown fields from the command-line TITiAN Linux - Software 2 02-08-2010 05:27 PM
Need a How-to on installing a VM on top of SunOS 5.10 Generic_141445-09 i386 CyberJet Linux - Virtualization and Cloud 1 10-28-2009 11:12 PM
top command - Time shown sameer29 Linux - Newbie 3 06-12-2008 02:59 PM
While booting no option is shown for Linux! Only windows xp is shown!! mon avis Linux - General 7 08-06-2006 04:14 PM
4 CPU's shown in top and /proc/cpuinfo Kristijan Linux - General 6 01-25-2005 08:09 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 12:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration