You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2001/10/04 18:46:56 UTC

DO NOT REPLY [Bug 3975] New: - XMLPlatformUtils::Initialize() leaks memory after thousands of calls (didn't in 1.2)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3975>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3975

XMLPlatformUtils::Initialize() leaks memory after thousands of calls (didn't in 1.2)

           Summary: XMLPlatformUtils::Initialize() leaks memory after
                    thousands of calls (didn't in 1.2)
           Product: Xerces-C++
           Version: 1.4
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Miscellaneous
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: roche@watchmark.com


XMLPlatformUtils::Initialize(), if it's called in a loop thousands of times
(don't have exact number), starts leaking memory like crazy.  This was
discovered when we upgraded from Xerces 1.2 to 1.4.  It turned out that we had a
XML utility library that called XMLPlatformUtils::Initialize() every time that a
method was called.  Long running tests call this method over and over.  In 1.2,
we never had issues, but in Xerces 1.4, we had massive memory leaks.  Running
Purify on a short test showed no leaks, but running Purify over night showed
that XMLPlatformUtils::Initialize() was the sole point of all leaks.  Perhaps
some reference count is rolling over, and the logic isn't robust after that
point?  (Yes, I know the docs say to call XMLPlatformUtils::Initialize() only
once per process, but it seems like it should be robust either way -- either
throw an AlreadyInitialized exception on the second call, or handle infinite
Initialize() calls, but don't have Initialize be a "ticking time bomb").

Anyway, we fixed our Initialize() usage to be in line with the Xerces docs, and
the problem went away.

Other than this, Xerces has been rock solid and very predictable -- thanks for
the great tool!

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org