Hello,
I have a customer that created a complex merge field and every time I tried to merge against this document a memory leak occurs and the computer has to be restarted or my application killed via the task manager. We are using the Aspose dll version 11.2
FYI…If I run this same document using straight MS Word merge functionality it works without a problem.
The data that the ASPOSE instance uses comes via a data table and the code is pretty straight forward after that:
Dim asposeDoc As Aspose.Words.Document
asposeDoc = New Aspose.Words.Document(dcDef.DocumentPath)
asposeDoc.MailMerge.Execute(dcDef.DocumentMergingDatatable) 'when this is called that’s when the memory leak occurs, it just hangs there.
The merge document with the problematic merge field is attached for your review, the field being reference is a date field.
Thank you in advance.
Hi Lesster,
Thanks for your inquiry. While using the latest version of Aspose.Words i.e. 11.6.0, I was unable to reproduce this problem on my side. I would suggest you please upgrade to the latest version of Aspose.Words i.e. v11.6.0 and let us know how it goes on your side.
Moreover, I used the following code for testing:
Document doc = new Document(@"C:\test\mergefieldmemoryleak.dot");
doc.MailMerge.Execute( new string[] { "loan_first_pmt_date" }, new object[] { "test value" });
doc.Save(@"C:\test\out.docx");
Best Regards,
Hello,
Thank you for your quick response but your test is not correct because you are not putting a date value as your “test value”. Therefore, the merge field doesn’t evaluate which is what’s causing the problem.
I created a small application, and used ASPOSE version 11.6.0.0, to implement the code that you provided, the only change that i made was to use a date value, and the memory leak occurs.
If you can please retest using a date value as shown below you should experience the problem that I’m experiencing. Thank you in advance for your help.
Document doc = new Document(@"C:\test\mergefieldmemoryleak.dot");
doc.MailMerge.Execute(new string[] { "loan_first_pmt_date" }, new object[] { "08/25/2012" });
doc.Save(@"C:\test\out.docx");
Hi
Lesster,
Thanks for the additional information. I managed to reproduce this exception on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-6725. Your request has been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.
Best Regards,