We are using Aspose.CAD in .NET to convert CAD files to PNGs.
For some CAD files, Aspose uses A LOT of RAM when converting to PNGs. This is e.g. the case for the following file: dwg.7z (509.8 KB)
We are using the following code for the conversion:
var image = Image.Load(input.Stream);
await image.SaveAsync(outputStream, new PngOptions
{
ResolutionSettings = new ResolutionSetting(image.Height, image.Width),
VectorRasterizationOptions = new CadRasterizationOptions
{
DrawType = CadDrawTypeMode.UseObjectColor
},
CancellationToken = cancellationToken,
});
Is it possible to limit the amount of RAM that Aspose is allowed to use?
This is e.g. possible in ImageMagick, which will automatically swap to disk when the maximum RAM usage is exceeded.