logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabijan...@nucorsteel.com
Subject RE: Memory Leaks in Log4cxx
Date Wed, 28 Jul 2004 11:42:51 GMT





Hemant,

even if you do what Michael proposed here you will still see the same
output you've originally had due to the fact that some non-static
memory/resources are dynamically allocated and never explicitly freed. If
you have not done so yet, try to run the example with checkpoints I've sent
in one of the replies, it'll give you a better idea of what is going on.

Alex



                                                                           
             Hemant                                                        
             <hemantc@in-reali                                             
             ty.com>                                                    To 
                                       'Log4CXX User'                      
             07/28/2004 02:13          <log4cxx-user@logging.apache.org>   
             AM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         RE: Memory Leaks in Log4cxx         
              "Log4CXX User"                                               
             <log4cxx-user@log                                             
             ging.apache.org>                                              
                                                                           
                                                                           
                                                                           




Hi,
I will try to check that out..

-Hemant

-----Original Message-----
From: Michael CATANZARITI [mailto:mcatan@free.fr]
Sent: Tuesday, July 27, 2004 8:09 PM
To: Log4CXX User
Subject: RE: Memory Leaks in Log4cxx


Hello,

That's right.

You don't have to call _CrtDumpMemoryLeaks directly. Indeed, you will cause
the
dump to begin before all static class members are destroyed.

Just use the following line
_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG|_CRTDBG_LEAK_CHECK_DF);

with the flag _CRTDBG_REPORT_FLAG, CRT automatically calls
_CrtDumpMemoryLeaks
after all global variables have been destroyed.

Michaƫl

Selon FabijanicA@nucorsteel.com:

>
>
>
>
>
> I'm trying to figure out how does this memory debugging actually work.
I'm
> not sure we are using Crt... functions in a proper way.
>
> I get a leak report by running this:
>
> #include <windows.h>
> #include <crtdbg.h>
>
> int main(int argc, char* argv[])
> {
>     _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
>     _CrtDumpMemoryLeaks();
>     return 0;
> }
>
> I think you have to set checkpoints and check for differences between
them.
> apparently, with your log4cxx example leaks are really only occuring on
> program exit . i'll keep you posted ...
>
>
>
>
>              Hemant
>              <hemantc@in-reali
>              ty.com>
To
>                                        'Log4CXX User'
>              07/27/2004 09:12          <log4cxx-user@logging.apache.org>
>              AM
cc
>
>
Subject
>              Please respond to         RE: Memory Leaks in Log4cxx
>               "Log4CXX User"
>              <log4cxx-user@log
>              ging.apache.org>
>
>
>
>
>
>
>
> Hi,
> Did you examine the following files for memory leaks :-
> basiconfigurator.cpp
> logmanager.cpp
>
> -Hemant
>
> -----Original Message-----
> From: FabijanicA@nucorsteel.com [mailto:FabijanicA@nucorsteel.com]
> Sent: Tuesday, July 27, 2004 6:17 PM
> To: Log4CXX User
> Subject: RE: Memory Leaks in Log4cxx
>
>
>
>
>
>
>
> And here is the actual dump:
>
> (See attached file: memleaks.txt)
>
>
>
>







Mime
View raw message