Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

High memory usage on MSXML6 transform, causes whole system to freeze

$
0
0

Hi everyone,

I am trying to resolve the following issue. There seems to be a huge leak when running a transform using a specific version of msxml6. A quite big piece of xml (~140mb of unicode xml string) needs to be transformed. When running this piece of code:

// Create processor and check created ok
::IXSLProcessorPtr pIXSLProcessor = m_pIXSLTemplate->createProcessor();

if (pIXSLProcessor != NULL)
{
    // Variant for source XML document
    VARIANT varSourceDoc;

    // Set XSLT processor source document location
    varSourceDoc.vt       = VT_DISPATCH;
    varSourceDoc.pdispVal = rxmlSource.GetXmlDocument();

    // Set the source XML document and check it is ok
    if (S_OK == pIXSLProcessor->put_input(varSourceDoc))
    {
        // Set the result stream and check it is ok
        if (S_OK == pIXSLProcessor->put_output(_variant_t(&rxmlStream.GetStreamObject())))
        {
            // Transform the documentVARIANT_BOOL varStatus = pIXSLProcessor->transform();

            // Check transform ok
            if (varStatus == VARIANT_TRUE)

            // Set the return flag
            fXslSetOk = true;
        }
    }
}

the pIXSLProcessor->transform() is hit, and then theraw_transform function is called, in msxm6.tli, which does this:

inline VARIANT_BOOL IXSLProcessor::transform ( ) {
    VARIANT_BOOL _result = 0;
    HRESULT _hr = raw_transform(&_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _result;
}

After the moment raw_transform is hit, memory starts growing very fast, starting from 200mb for that process, to 1gb, then 2gb, then 4gb, and then it hangs my whole system and I need to reset. 

I am using Windows 8 (64bit). This issue occurs only with the following version of msxml6.dll:
Product name: Microsoft XML Core Services
Product version: 6.30.9200

I have found other versions from other windows installations, and the transform works fine for one of them, after I copied them over temporarily in C:/Windows/System32. The other versions I tried are:

WORKS:

Product name: Microsoft(R) MSXML 6.0 SP3
Product version: 6.30.7601
Taken from: Windows 7

and

DOES NOT WORK:

Product name: Microsoft XML Core Services
Product version: 6.30.9600
Taken from: Windows 8.1

Since this only happens on these two versions, could it be a bug?

I have tried updating my msxml6, but it's quite hard to find the version I need online. Presumably this https://www.microsoft.com/en-gb/download/details.aspx?id=6276 would be it (although it mentions version 6.10.1129.0, and it's only SP1, not SP3), but install does not seem to update my msxml6.dll.

I have spent a lot of time on this, any help would be appreciated.

Regards,

Stathis





Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>