OutOfMemory – Large MergeDocument

Home Forums Open-Xml-PowerTools OutOfMemory – Large MergeDocument

This topic contains 2 replies, has 2 voices, and was last updated by  knut 5 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7601

    knut
    Participant

    We are trying to merge a fairly complex Word document to a large number of recipients using OpenXmlPowerTools (ver 4.5.3.2). It seems like the merged document object hits the 2 GB object size limit in .Net, resulting in an OutOfMemoryException. I have set <gcAllowVeryLargeObjects enabled=”true”/>, but it doesn’t make any difference.

    The exception seems to happen in the DocumentBuilder.BuildDocument method.

    Is there a solution for this?

    #7602

    Eric White
    Keymaster

    There are some scenarios where the only solution is to build a 64-bit exe. I have never run out of memory when using 64-bit.

    #7607

    knut
    Participant

    Hi,

    Thanks for your answer. Compiling for 64bit didn’t make any difference – but probably the problem is not in OpenXmlPowerTools after all.

    I made a small test app, just performing the merge. It completes fine (although it takes more than 30 minutes…) on the same server where the actual “serious” application crashes, and it allocates a lot of RAM (~7GB) for the merge process.

    The actual application is a server application, running standalone (OWIN) as a Windows service. The 2GB limit is probably enforced by some of the surrounding infrastructure, I am struggling to find out where.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.