System.OutOfMemoryException while generating and converting 6000 pages of word document to PDF

We have recently upgrade our application from .NET core 7 to 8. We are using Aspose.PDF and Word to generate and convert documents from Word to PDF. In our earlier releases we didnt face issues with performance testing of (6000 page of word document generation and conversion) but now we are facing below issue post upgrade to .NET Core 8. Please let us know how to resolve the below issue

Exception in MergeDocuments,"System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.IO.MemoryStream.set_Capacity(Int32 value)
   at System.IO.MemoryStream.EnsureCapacity(Int32 value)
   at System.IO.MemoryStream.Write(ReadOnlySpan`1 buffer)
   at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
   at System.Xml.XmlTextWriter.AutoComplete(Token token)
   at System.Xml.XmlTextWriter.WriteEndAttribute()
   at    (String , Object )
   at    . (String , Object[] )
   at    . (    ,     , Boolean )
   at    .VisitRowStart(Row )
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at   	(CompositeNode )
   at    .()
   at    .      ()
   at    . ()
   at   . ()
   at           )
   at    .        )
   at Aspose.Words.Document.     )
   at Aspose.Words.Document.(Stream , String , SaveOptions )
   at Aspose.Words.Document.Save(Stream stream, SaveOptions saveOptions)
   at Aspose.Words.Document.Save(Stream stream, SaveFormat saveFormat)

@ShafeerAli Could you please attach your input document here for testing? We will check the issue and provide you more information.

Please note, 6k pages MS Word document is an extremally huge document and even MS Word not always can process such documents. But all depends on the inner document content. If such document consists of pure textual content, I doubt , that either MS Word or Aspose.Words can process 6k pages document with pure text. Please see our documentation to learn more about Aspose.Words memory requirements:
https://docs.aspose.com/words/net/memory-requirements/