Environment:
Linux Ubuntu x86_64 docker
.NETCORE 3.1
aspose.slides.net 23.1
Problem:
Open a 35M pptx file and save it. The memory increases by 1G.
The memory is not released, and the memory for repeated operations keeps increasing.
LoadOptions loadOptions = new LoadOptions
{
BlobManagementOptions = new BlobManagementOptions
{
PresentationLockingBehavior = PresentationLockingBehavior.KeepLocked,
IsTemporaryFilesAllowed = true
}
};
using (Presentation presentation = new Presentation(filePath, loadOptions))
{
string dirPath = Path.GetDirectoryName(filePath);
string name = Guid.NewGuid().ToString("N") + extName;
string newFilePath = Path.Combine(dirPath, name);
presentation.Save(newFilePath, SaveFormat.Pptx);
}
dotnet-dump info:
GC gen2(fraction info)
00007f32452d2c18 12729 407328 System.Collections.Generic.List<Aspose.Slides.IColorOperation>
00007f32453bd548 4885 429880
00007f324545c700 5905 472400 Aspose.Slides.Portion
00007f324519c148 4010 481200 Aspose.Slides.BulletFormat
00007f3245198c68 3666 498576
00007f32452d26b8 12729 509160 Aspose.Slides.ColorOperationCollection
00007f3244635728 241 514232 System.Int64[]
00007f32452cfe00 6224 547712 Aspose.Slides.PictureFillFormat
00007f32452d0880 6316 555808 Aspose.Slides.GradientFormat
00007f32452d0cf8 6316 555808 Aspose.Slides.PatternFormat
00007f324519e508 10028 561568
00007f3245443c58 2138 564432 Aspose.Slides.AutoShape
00007f32452d28c8 8846 566144
00007f32452d0e98 9131 584384
00007f32452d1518 12729 610992
00007f324541a358 4070 618640
00007f323f7314c0 2537 676102 System.Byte[]
00007f32443af1b8 17630 705200 System.Xml.NameTable+Entry
00007f32453c52f0 14451 809256
00007f3245196538 6475 828800 Aspose.Slides.ParagraphFormat
00007f324519fc10 10859 868720 Aspose.Slides.EffectFormat
00007f32452d1d18 12729 1018320
00007f324519ce30 10028 1363808 Aspose.Slides.PortionFormat
00007f32452cd1e0 7042 1577408
00007f324519f1e8 23748 2469792 Aspose.Slides.LineFormat
00007f324519e810 24632 2758784 Aspose.Slides.FillFormat
00007f324519e188 27151 2823704 Aspose.Slides.ColorFormat
00007f323f730f90 56332 3686968 System.String
Total 680453 objects
do 00007f30b03dd780
Name: System.String
MethodTable: 00007f323f730f90
EEClass: 00007f323f69e230
Size: 1008(0x3f0) bytes
File: /usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.20/System.Private.CoreLib.dll
String: <a:ext uri="{BEBA8EAE-BF5A-486C-A8C5-ECC9F3942E4B}" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a14:imgProps xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main"><a14:imgLayer r:embed="rId2" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><a14:imgEffect><a14:brightnessContrast bright="-40000" contrast="20000" /></a14:imgEffect><a14:imgEffect><a14:saturation sat="200000" /></a14:imgEffect></a14:imgLayer></a14:imgProps></a:ext>
Fields:
MT Field Offset Type VT Attr Value Name
00007f323f72a0e8 400022a 8 System.Int32 1 instance 493 _stringLength
00007f323f726f00 400022b c System.Char 1 instance 3c _firstChar
00007f323f730f90 400022c 108 System.String 0 static 00007f2eaffff360 Empty
do 00007f30b043b4b0
Name: System.String
MethodTable: 00007f323f730f90
EEClass: 00007f323f69e230
Size: 630(0x276) bytes
File: /usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.20/System.Private.CoreLib.dll
String: <a:ext uri="{96DAC541-7B7A-43D3-8B79-37D633B846F1}" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><asvg:svgBlip xmlns:asvg="http://schemas.microsoft.com/office/drawing/2016/SVG/main" r:embed="rId2" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" /></a:ext>
Fields:
MT Field Offset Type VT Attr Value Name
00007f323f72a0e8 400022a 8 System.Int32 1 instance 304 _stringLength
00007f323f726f00 400022b c System.Char 1 instance 3c _firstChar
00007f323f730f90 400022c 108 System.String 0 static 00007f2eaffff360 Empty