Free Support Forum - aspose.com

Getting out of memory exception while generating a word document

Hi,

i am getting outof memory exception while generation word document with 900 records of data.

i am using aspose java jdk1.4 and java 1.5

can you please let us know upto how much mb we can genarate a word document.

i am attaching the template for ur referrence.

we have found a smiliar issue and saw that was fixed in the latest version of .net. we have checked this with the latest version of java but still we are getting out of memory exception.
http://www.aspose.com/community/forums/2/218913/out-of-memory-exception-on-document.save-with-docx-and-doc/showthread.aspx

Can any one please help us on this..

Advance Thanks





Hi

Thanks for your request. There is no limit of number of pages or document size. But you should note, usually Aspose.Words needs few times more memory than document size to build model of the document in memory. Memory usage depends on document size, format and document’s content.

So in your case the only way you can process really big documents if you give more heap space to your Java virtual machine. Aspose.Words will take loads of memory when loading/process the document, but when you finished processing the document, all memory will be released and garbage collected quickly. So it will be only a short spike of high memory use.

Also, I would like to say that producing huge MS Word documents is not very good practice. Ms Word does not like huge documents. Usually it takes a lot of time to open such documents in MS Word and sometimes MS Word just hangs. Normal size of MS Word documents is 100 – 200 pages.

Best regards,