We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Big size TXT crashes on import using C#

Hi,

When I try to instantiate a new instance with a filename that is a textfile size 225Mbs - the app crashes.
Sample code:

Dim msgDocument As Aspose.Words.Document = New Aspose.Words.Document(fileName);

I assume this is due to a out of memory exception. Do you have any guidance on how this can handled so that it doesn’t crash? I realize that this exception is hardware dependent - but I am looking at a compromise.

I use Aspose.Words 19.3.0.0.

Regards,

@mradu

Please note that performance and memory usage all depend on complexity and size of the documents you are generating.

In terms of memory, Aspose.Words does not have any limitations. If you’re loading huge Word documents into Aspose.Words’ DOM, more memory would be required. This is because during processing, the document needs to be held wholly in memory. Usually, Aspose.Words needs 10 times more memory than the original document size to build a DOM in the memory.

The easy way to workaround this issue is to increase the memory size.

@mradu

Further to my previous post, we have added new property LoadOptions.TempFolder in the latest version of Aspose.Words. We suggest you please use this property while loading the TXT document. Hope this helps you.

LoadOptions lo = new LoadOptions();
lo.TempFolder = @"C:\TempFolder\";
  
Document doc = new Document(myDir + "document.txt", lo);