SaveOptionsMemoryOptimization Property

Gets or sets value determining if memory optimization should be performed before saving the document. Default value for this property is false.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.10.0


public bool MemoryOptimization { get; set; }

Property Value

Type: Boolean


Setting this option to true can significantly decrease memory consumption while saving large documents at the cost of slower saving time.


Shows an option to optimize memory consumption when you work with large documents.
Document doc = new Document(MyDir + "Rendering.docx");

// When set to true it will improve document memory footprint but will add extra time to processing
SaveOptions saveOptions = SaveOptions.CreateSaveOptions(SaveFormat.Pdf);
saveOptions.MemoryOptimization = true;

doc.Save(ArtifactsDir + "PdfSaveOptions.MemoryOptimization.pdf", saveOptions);

ExpandedSee Also