General
cancel
Showing results for 
Search instead for 
Did you mean: 

In which case memory leak happen ?

nallamolu
Advisor

In which case memory leak happen ?

Hi World,

This Question is related to linux environment in 2 different cases.

1.) I am accessing process related info in c using /proc/pid/stats file system.

2.) I am accessing same process related info in c using getrusage( ) system call.

In which case memory leak may happen if i run the application for 1 month or more.

Thanks in advance,
Gopi
2 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: In which case memory leak happen ?

Hi Gopi:

Your question lacks the details of the code you intend to use! A memory leak is a _bug_ in code where you have allocated memory ('malloc()' et al.) but subsequently not 'free()'ed that memory leaving it forgotten and unaccounted for in your application.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: In which case memory leak happen ?

Shalom Gopi,

Be sure which program is leaking memory.

http://www.hpux.ws/?p=8
Memory leak detector.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com