Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-117

Memory leak with ThreadSpecificData on Win32

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.10.0
    • 0.10.0
    • None
    • None
    • Win32

    Description

      I use the VLD (visual leak detector) with my applications and log4cxx and noticed quite some memory leaks. Well, in my specific application a huge number of threads might be spawn in the course of time. Is there a way to get rid of the ThreadSpecificData again? My application runs on Win32, and so the APRInitializer::tlsDestruct() won't be called.
      Consequently I've patched log4cxx by introducing a method to explicitly free the ThreadSpecificData, but that's of course not transparent. Is there an intend to provide the same behaviour of the APR for Win32 eventually? Any other ideas about that problem?

      Call freeCurrentData() just before your thread terminates in order to free the thread specific data.

      Attachments

        1. threadspecificdata.cpp.diff
          0.7 kB
          Kriz
        2. threadspecificdata.h.diff
          0.6 kB
          Kriz

        Activity

          People

            carnold@apache.org Curt Arnold
            chris75vie Kriz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: