|
From: <k_n...@ya...> - 2004-05-21 08:12:13
|
hi,
i have to find memory leaks for a daemon process.
features of my daemon:
---------------------------
1) When the dameon starts it
a) initialises a large memory of bytes in
anticipation of further requests of memory at the
initialization function of the daemon and
b) allocate memory when certain tasks are done
as it executes that function.
2) It calls external library functions like openssl
3) uses only glibc memeory managemnt routines like
malloc,free,calloc
required feature:
-----------------
1) What i am interested is finding leaks due to
feature 1b) i.e when a function A is called it
allocates memory x and when i call function B it frees
the memory allocated by function A. i want to know
whether all the memory allocated by A is freed by B.
2) Does valgrind help in such situations? i.e i
want to see memeory leaks when certain events have
happened in the program. not bothered abt the memory
leaks in other functions ( or pseudo memory as in
1a) . or else it may give a detailed log saying all
the memory allocations which have happened.. which may
not be of much use to find memory leak in a certain
module.
any help is welcome.
have a nice day,
navin.
=====
____________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
|
|
From: Banibrata D. <du...@in...> - 2004-05-21 08:21:37
|
why not just ignore the leaks reported in the part of code which is doing memory-pooling, or write explicit supressions for them! -bd > -----Original Message----- > From: val...@li... > [mailto:val...@li...] On Behalf > Of navin gopalakrishnan > Sent: Friday, May 21, 2004 1:42 PM > To: val...@li... > Subject: [Valgrind-users] finding memory leaks in a dameon > > > hi, > > i have to find memory leaks for a daemon process. > > features of my daemon: > --------------------------- > 1) When the dameon starts it > a) initialises a large memory of bytes in > anticipation of further requests of memory at the > initialization function of the daemon and > b) allocate memory when certain tasks are done > as it executes that function. > 2) It calls external library functions like openssl > 3) uses only glibc memeory managemnt routines like malloc,free,calloc > > > required feature: > ----------------- > 1) What i am interested is finding leaks due to > feature 1b) i.e when a function A is called it > allocates memory x and when i call function B it frees > the memory allocated by function A. i want to know > whether all the memory allocated by A is freed by B. > > 2) Does valgrind help in such situations? i.e i > want to see memeory leaks when certain events have > happened in the program. not bothered abt the memory > leaks in other functions ( or pseudo memory as in > 1a) . or else it may give a detailed log saying all > the memory allocations which have happened.. which may > not be of much use to find memory leak in a certain > module. > > any help is welcome. > > have a nice day, > navin. > > ===== > > > > > > > ____________________________________________________________ > Yahoo! Messenger - Communicate instantly..."Ping" > your friends today! Download Messenger Now > http://uk.messenger.yahoo.com/download/index.html > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... > Oracle 10g. > Take an Oracle 10g class now, and we'll give you the exam > FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Valgrind-users mailing list Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
|
From: Nicholas N. <nj...@ca...> - 2004-05-21 11:36:30
|
On Fri, 21 May 2004, navin gopalakrishnan wrote: > features of my daemon: > --------------------------- > 1) When the dameon starts it > a) initialises a large memory of bytes in > anticipation of further requests of memory at the > initialization function of the daemon and > b) allocate memory when certain tasks are done > as it executes that function. > > required feature: > ----------------- > 1) What i am interested is finding leaks due to > feature 1b) i.e when a function A is called it > allocates memory x and when i call function B it frees > the memory allocated by function A. i want to know > whether all the memory allocated by A is freed by B. > 2) Does valgrind help in such situations? i.e i > want to see memeory leaks when certain events have > happened in the program. not bothered abt the memory > leaks in other functions ( or pseudo memory as in > 1a) . or else it may give a detailed log saying all > the memory allocations which have happened.. which may > not be of much use to find memory leak in a certain > module. I'm not sure if I completely understand your requirements. If you have a custom memory allocator, and you want to find leaks of blocks allocated by it, you can use the VALGRIND_MALLOCLIKE_BLOCK and VALGRIND_FREELIKE_BLOCK client requests; see section 3.6 of developer.kde.org/~sewardj/docs-2.0.0/mc_main.html. If you want to force a leak check before the program's end, you can use the VALGRIND_DO_LEAK_CHECK client request, also explained in that section of the manual. Section 2.7 of the manual (developer.kde.org/~sewardj/docs-2.0.0/coregrind_core.html) has info about how to use client requests in general. HTH N |