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

Free Support Forum - aspose.com

AposeAPI consume too much memory

Hello,

We use your product to convert docx(and many other formats) to png files. During our tests we discovered that your engine consume too much memory.

For example we created 3MB(only!) docx file with 1200 pages, which include only the text, and once the file is passed to Aspose API(Open+GetPageCount), the process consumed +750mb of RAM, which is unreasonable for us, since we are running on server application and memory is critical for us.

Is there any way to improve memory consumption in case we never need to convert whole document to png files, but single page step-by-step?

P.S. we discovered this issue only after purchasing and using the full license, because evaluation version render only first 4 pages and consumed much less memory on the same file.

(The file from the example is attached)

Thanks in advance

Itamar Waiss,

Senior Software Engineer at Varonis.

Hi,

Thanks for your inquiry. After an initial test with Aspose.Words for .NET 13.9.0, I was unable to reproduce this performance issue on my side. The conversion took just 99.6 seconds on my side over a 64-bit Windows 7 machine. In case you're running an older version, I would suggest you please upgrade to the latest version of Aspose.Words. I hope, this helps.

In case the problem still remains, please supply us with the following information, if you cannot supply us with this information we will not be able to investigate your issue and raise a ticket.

  • What version of Aspose.Words for .NET/Java are you using?
  • What environment are you running on?
  • OS (Windows Version or Linux Version)
  • Architecture (32 / 64 bit)
  • .NET Framework version (or Java version)
  • Any Third Party Libraries / SDK in addition to Aspose Products
  • Please supply us with the code from your application that is causing the issue

As soon as you get these pieces of information to us we'll start our investigation into your issue.

Best regards,

Hi.

Our issue is not the speed, but the memory consumption, the process consumed +750mb of RAM , while operating on the file.

Thanks in advance<?xml:namespace prefix = "o" />

Itamar Waiss,

Senior Software Engineer at Varonis.

Here are the details:

  • Aspose.Words for .NET 13.9.0
  • visual studio 2010
  • OS = Windows Version
  • Architecture = 32 bit and 64 bit
  • .NET Framework 3.5
  • code:
  • var docWord = new Aspose.Words.Document(@"c:\a.docx");

    int pageCount = docWord.PageCount;

    string filename = @"C:\test.png";

    ImageSaveOptions options = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Png);

    options.PageIndex = 1;

    docWord.Save(filename, options);

    Thanks in advance<?xml:namespace prefix = "o" />

    Itamar Waiss,

    Senior Software Engineer at Varonis.

    Hi Itamar,


    Thanks for the additional information. The maximum amount of physical memory consumed by the process was 408.82Mb on my side. I have logged this problem in our issue tracking system as WORDSNET-9077. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

    Best regards,

    Hi,

    this puts us in a bad place, since there was no way for us to discover this in the trial version we are now stuck.

    the memory consumption is too high and will not work for us.

    Im going to take it up to higher management and decide what to do - a refund is defiantly on the table.

    <?xml:namespace prefix = "o" />

    Itamar Waiss,

    Senior Software Engineer at Varonis

    Hi Itamar,

    Thanks for your inquiry.

    Memory usage is completely dependent on document size and document complexity. Usually, Aspose.Words needs 10 times more memory than the original document size to build it's DOM in the memory and when it comes to rendering a document to fixed page formats (e.g. PDF, image formats), Aspose.Words needs to build two model in the memory – one for document and the other for rendered document. Document.PageCount property also invokes page layout routine which builds the two document models in memory. That is why Aspose.Words utilizes more memory when you render a document than when you simply save a document in flow formats (e.g DOCX). So, it is better to use few small documents instead of one huge document. If we can help you with anything else, please feel free to ask.

    Best regards,

    Thanks for the answers.


    Unfortunately we cannot control the sizes of the files as they are real user files that we want to convert to images.
    We are building a server side component that needs to handle multiple requests at the same time,
    Therefore memory consumption is an important issue. is there any way to limit the amount of memory used for reading of a single file? read parts of it?

    The eval version Aspose would render just ~ 4 pages and wouldn’t load the entire dom. (therefore keeping memory nice and low)
    how can we control loading parts of the dom?

    and when you say Aspose needs 10 times more memory than the original file, 10 times more than what? the file size was less than 3 mb.

    Thanks!

    Hi Itamar,


    Thanks for your inquiry. If your document’s size is 1 MB, Aspose.Words will need 10~20 MB of RAM to build its DOM in memory. Multiplier depends on format because some formats are more compact than others. For example DOCX format is more compact than DOC and RTF, and DOC is more compact than RTF. In your case, the current architecture of Aspose.Words requires so much memory because your document has many pages (i.e. 1141 pages, 568259 words). Our development team needs to investigate the best possible way to fix this issue. We will inform you as soon as this issue is resolved. We apologize for your inconvenience.

    Best regards,

    Hi Itamar,


    Thanks for being patient.

    Regarding WORDSNET-9077, I like to share that we have now improved the performance of Aspose.Words to a great deal by carrying out improvements in layout engine. We have just released a new version of Aspose.Words 14.1.0 which contains these performance improvements. You can download this version from the following link:
    http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/entry524475.aspx

    We always strive to fix performance issues and you are likely to see more improvements in every release from now on. Currently, the memory consumption is decreased by 27.15%. Please let us know if this is acceptable for you so that we can close this issue.

    Best regards,
    Hi Itamar,

    Thanks for being patient. Regarding WORDSNET-9077, please upgrade to the latest version of Aspose.Words 17.1.0 and try using SaveOptions.MemoryOptimizations property which gives about 150Mb more memory gained on our end. Hope, this helps.
    https://downloads.aspose.com/words/net

    Please let us know if this is acceptable for you so that we can close this issue.

    Best regards,