You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Noam Rathaus <no...@beyondsecurity.com> on 2010/10/19 07:23:34 UTC

log4cxx Visual Studio/Windows memory cleanup

Hi,

I used log4cxx since 2003, using several versions of Visual Studio, when
we upgraded to Visual Studio 2010, a memory leak/cleanup issue has appeared.

When the program terminates a memory leak can be seen.

The memory leak is from the log4cxx objects.

Even though I am using smart pointers when accessing and creating the
log4cxx objects, the leak is still there.

I have added the log4cxx::LogManager::shutdown() call to try and get it
to cleanup on itself, but it doesn't work.

I added debug code to verify that releaseRef of the objects is called,
and I noted that it is, however it is called for the "wrong" objects -
i.e. to a copy of them and not the original one.

So at some point they are getting copied and the original is kept but
"knowledge" of it is "lost".

The code is very simple 5 lines, which as I mentioned before, work
without leaking in previous versions.

Anyone with pointers to what I should look into?

I can provide additional details if needed.

Thanks,
Noam