How to find out the memory size used by a process or check its memory leaking?

How to find out the memory size used by a process or check its memory leaking?

Post by Ji » Wed, 08 Aug 2001 01:36:17



I want to find out how many memory is used by a process P. Process P
is running on Solaris 8 sun workstation. Basically, I want to know if
there is memory leaking from process P. Could someone tell me how to
do this?

Thanks

 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Dave Hi » Wed, 08 Aug 2001 02:19:51


: I want to find out how many memory is used by a process P. Process P
: is running on Solaris 8 sun workstation. Basically, I want to know if
: there is memory leaking from process P. Could someone tell me how to
: do this?

Can you tell us, please,when your homework is due, so we know how
much time we have?

 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Mike Marsha » Wed, 08 Aug 2001 03:20:15




>: I want to find out how many memory is used by a process P. Process P
>: is running on Solaris 8 sun workstation. Basically, I want to know if
>: there is memory leaking from process P. Could someone tell me how to
>: do this?
>Can you tell us, please,when your homework is due, so we know how
>much time we have?

If process P's pid is 1234, then a comparison of   ps -o osz -p 1234
over time should tell you if the process is growing. That might
not mean that it has a "leak" (faulty logic in freeing dynamically
allocated memory). An analysis tool you can buy, purify, is designed
for identifying memory leaks. There's tools in the solaris workshop
too.

-Mike

 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Nithyanandha » Wed, 08 Aug 2001 04:58:39



> I want to find out how many memory is used by a process P. Process P
> is running on Solaris 8 sun workstation.

use getrusage()

Quote:> Basically, I want to know if
> there is memory leaking from process P. Could someone tell me how to
> do this?

First look at your code carefully to check whether you release the
allocated memory. You should be able to track these problems.

Memory leak detecting tools like Purify can help you more. If you want to
go for differrent tools like purify, then :-
www.cs.colorado.edu/homes/zorn/public_html/MallocDebug.html will give you
the answer.

--

Nithyanand.
Siemens, Bangalore, India.
(Opinions expressed are my own and do not reflect the opinions of my
employer, Siemens)

 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Ji » Wed, 08 Aug 2001 05:54:10




> : I want to find out how many memory is used by a process P. Process P
> : is running on Solaris 8 sun workstation. Basically, I want to know if
> : there is memory leaking from process P. Could someone tell me how to
> : do this?

> Can you tell us, please,when your homework is due, so we know how
> much time we have?

This is not homework. I am disappointed.
 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Ji » Wed, 08 Aug 2001 05:58:06





> >: I want to find out how many memory is used by a process P. Process P
> >: is running on Solaris 8 sun workstation. Basically, I want to know if
> >: there is memory leaking from process P. Could someone tell me how to
> >: do this?

> >Can you tell us, please,when your homework is due, so we know how
> >much time we have?

> If process P's pid is 1234, then a comparison of   ps -o osz -p 1234
> over time should tell you if the process is growing. That might
> not mean that it has a "leak" (faulty logic in freeing dynamically
> allocated memory). An analysis tool you can buy, purify, is designed
> for identifying memory leaks. There's tools in the solaris workshop
> too.

> -Mike

thanks. Could you tell me what is the tools in solaris workshop?
 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Norm » Wed, 08 Aug 2001 07:05:43



> I want to find out how many memory is used by a process P. Process P
> is running on Solaris 8 sun workstation. Basically, I want to know if
> there is memory leaking from process P. Could someone tell me how to
> do this?

> Thanks

ls /usr/proc/bin | xargs man

--
md5sum - Unix virus scanner.



 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Nithyanandha » Wed, 08 Aug 2001 08:43:50



> > >: I want to find out how many memory is used by a process P. Process P
> > >: is running on Solaris 8 sun workstation. Basically, I want to know if
> > >: there is memory leaking from process P. Could someone tell me how to
> > >: do this?

> > >Can you tell us, please,when your homework is due, so we know how
> > >much time we have?

> > If process P's pid is 1234, then a comparison of   ps -o osz -p 1234
> > over time should tell you if the process is growing. That might
> > not mean that it has a "leak" (faulty logic in freeing dynamically
> > allocated memory). An analysis tool you can buy, purify, is designed
> > for identifying memory leaks. There's tools in the solaris workshop
> > too.

> thanks. Could you tell me what is the tools in solaris workshop?

Didn't you read the other posts in this thread?.  I had given the link where you can have the overall
view of these Memory leak detecting tools.
The link is
www.cs.colorado.edu/homes/zorn/public_html/MallocDebug.html
There are many such tools listed here. Select whichever is appropriate to you and your solaris.

--

Nithyanand.
Siemens, Bangalore, India.
(Opinions expressed are my own and do not reflect the opinions of my employer, Siemens)

 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Joe Blogg » Wed, 08 Aug 2001 19:57:29


/usr/proc/bin/pmap <pid>

...and monitor changes in the output, particularly in the "heap" section



> > > >: I want to find out how many memory is used by a process P. Process
P
> > > >: is running on Solaris 8 sun workstation. Basically, I want to know
if
> > > >: there is memory leaking from process P. Could someone tell me how
to
> > > >: do this?

> > > >Can you tell us, please,when your homework is due, so we know how
> > > >much time we have?

> > > If process P's pid is 1234, then a comparison of   ps -o osz -p 1234
> > > over time should tell you if the process is growing. That might
> > > not mean that it has a "leak" (faulty logic in freeing dynamically
> > > allocated memory). An analysis tool you can buy, purify, is designed
> > > for identifying memory leaks. There's tools in the solaris workshop
> > > too.

> > thanks. Could you tell me what is the tools in solaris workshop?

> Didn't you read the other posts in this thread?.  I had given the link

where you can have the overall
Quote:> view of these Memory leak detecting tools.
> The link is
> www.cs.colorado.edu/homes/zorn/public_html/MallocDebug.html
> There are many such tools listed here. Select whichever is appropriate to

you and your solaris.

- Show quoted text -

Quote:

> --

> Nithyanand.
> Siemens, Bangalore, India.
> (Opinions expressed are my own and do not reflect the opinions of my
employer, Siemens)

 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by John Blyt » Wed, 08 Aug 2001 21:47:08


watchmalloc does a similar task (if without purifys gui) and should be
installed already.

Try "man watchmalloc"

Cheers J.




> >: I want to find out how many memory is used by a process P. Process P
> >: is running on Solaris 8 sun workstation. Basically, I want to know if
> >: there is memory leaking from process P. Could someone tell me how to
> >: do this?

> >Can you tell us, please,when your homework is due, so we know how
> >much time we have?

> If process P's pid is 1234, then a comparison of   ps -o osz -p 1234
> over time should tell you if the process is growing. That might
> not mean that it has a "leak" (faulty logic in freeing dynamically
> allocated memory). An analysis tool you can buy, purify, is designed
> for identifying memory leaks. There's tools in the solaris workshop
> too.

> -Mike

 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Mathew Kirsc » Wed, 08 Aug 2001 23:37:27



> I want to find out how many memory is used by a process P. Process P
> is running on Solaris 8 sun workstation. Basically, I want to know if
> there is memory leaking from process P. Could someone tell me how to
> do this?

Put an empty garbage can underneath and leave it sit for a few hours. If the
can has memory in it when you come back, the process is leaking memory.

The top utility shows the size of processes.

 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Ji » Thu, 09 Aug 2001 01:48:47




> > > >: I want to find out how many memory is used by a process P. Process P
> > > >: is running on Solaris 8 sun workstation. Basically, I want to know if
> > > >: there is memory leaking from process P. Could someone tell me how to
> > > >: do this?

> > > >Can you tell us, please,when your homework is due, so we know how
> > > >much time we have?

> > > If process P's pid is 1234, then a comparison of   ps -o osz -p 1234
> > > over time should tell you if the process is growing. That might
> > > not mean that it has a "leak" (faulty logic in freeing dynamically
> > > allocated memory). An analysis tool you can buy, purify, is designed
> > > for identifying memory leaks. There's tools in the solaris workshop
> > > too.

> > thanks. Could you tell me what is the tools in solaris workshop?

> Didn't you read the other posts in this thread?.  I had given the link where you can have the overall
> view of these Memory leak detecting tools.
> The link is
> www.cs.colorado.edu/homes/zorn/public_html/MallocDebug.html
> There are many such tools listed here. Select whichever is appropriate to you and your solaris.

My previous reply is not for you and was sent out before your first
message and. Sorry for making your confused. I sugguest we should have
a thread link of posts.

My program uses STL List and Map classes and I put template class into
these Lists. When I monitor the output of vmstat for my workstation,
although the system may regain small portion of the memory, swap and
free memory have a trend to decrease , but I don't know which process
leaks memory.

Thanks you all for your help.

 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Chuck Dillo » Thu, 09 Aug 2001 03:32:44



> thanks. Could you tell me what is the tools in solaris workshop?

In workshop/forte you can enable leak checking from the GUI or
you can use dbx from the commandline along with the 'check -memuse'.
In dbx see 'help check' I believe.

-- ced

--
Chuck Dillon
Senior Software Engineer
Accelrys Inc., a subsidiary of Pharmacopeia, Inc.

 
 
 

How to find out the memory size used by a process or check its memory leaking?

Post by Mike Marsha » Thu, 09 Aug 2001 05:36:10


bcheck is the workshop component I was thinking of. It is a shell
script that uses dbx under the covers...

-Mike