Unix Programming - libgc.so

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > February 2004 > libgc.so





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author libgc.so
qazmlp

2004-02-19, 3:34 am

Memory leaks are found often in our C++ application which is running
on Solaris machine. So, it was decided to link with libgc.so which
comes with Solaris.

Before start doing that, I would want to know your
experiences/thoughts/suggestions on using this library.
- Will this really fix all memory leaks in a C/C++ application?
What are the leaks that can still escape from this?
- Will it cause any performance impacts ie. reducing the existing
performance
in a time critical application?
- Any other things that we have to take care?

Kindly pour in your suggestions.
Nils O. newsgroup user

2004-02-19, 4:34 am

In article <db9bbf31.0402190908.40d37ed6@posting.google.com>, qazmlp wrote:
> Memory leaks are found often in our C++ application which is running
> on Solaris machine. So, it was decided to link with libgc.so which
> comes with Solaris.

I'd say you should try rather hard with some memory leak finding
tool, and plug those rather.
> Before start doing that, I would want to know your
> experiences/thoughts/suggestions on using this library.
> - Will this really fix all memory leaks in a C/C++ application?

Often. Not guaranteed though.
> What are the leaks that can still escape from this?

Leaks that arn't true leaks. e.g. still keeping a pointer
to something you really should have disposed long ago.

> - Will it cause any performance impacts ie. reducing the existing
> performance
> in a time critical application?

malloc and especially free can take substancial longer time now.
> - Any other things that we have to take care?
>
> Kindly pour in your suggestions.



--
Vennlig hilsen/Best Regards
Nils Olav Selåsdal
System Engineer
w w w . u t e l s y s t e m s . c o m
Chandrakant Mohire

2004-02-19, 4:34 pm

There is another good tool purify that comes with solaris box.
This finds memory leaks - memory that has been allocated but can no
longer be acessed
because there are no pointers to it.
This also detects
reading / writing beyond array limit
reading / writing freed memory

Refer man purify

Rgds,
--Chandrakant



"qazmlp" <qazmlp1209@rediffmail.com> wrote in message
news:db9bbf31.0402190908.40d37ed6@posting.google.com...
> Memory leaks are found often in our C++ application which is running
> on Solaris machine. So, it was decided to link with libgc.so which
> comes with Solaris.
>
> Before start doing that, I would want to know your
> experiences/thoughts/suggestions on using this library.
> - Will this really fix all memory leaks in a C/C++ application?
> What are the leaks that can still escape from this?
> - Will it cause any performance impacts ie. reducing the existing
> performance
> in a time critical application?
> - Any other things that we have to take care?
>
> Kindly pour in your suggestions.



Alan Coopersmith

2004-02-19, 5:33 pm

"Chandrakant Mohire" <chandrakant.M@in.bosch.com> writes in comp.unix.solaris:
|There is another good tool purify that comes with solaris box.

Purify is good, but isn't included with Solaris. You have to buy it
from IBM (formerly Rational, before that PureAtria, and long ago, Pure
Software). http://www-306.ibm.com/software/awdtools/purifyplus/

Sun does have very similar functionality in the dbx debugger included
with the Sun Studio compiler products.

--
________________________________________
________________________________
Alan Coopersmith alanc@alum.calberkeley.org
http://www.CSUA.Berkeley.EDU/~alanc/ aka: Alan.Coopersmith@Sun.COM
Working for, but definitely not speaking for, Sun Microsystems, Inc.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com