Big memory usage


#1

test1.zip (408.8 KB)
I ran the following codes to output attached dxf as pdf:

final long beforeUsedMem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
final CadImage image = (CadImage) Image.load(“C:/test1.dxf”);
final CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.setPageSize(new com.aspose.cad.SizeF(800, 800));
rasterizationOptions.setCenterDrawing(true);
final PdfOptions pdfOptions = new PdfOptions();
pdfOptions.setVectorRasterizationOptions(rasterizationOptions);
image.save(“C:/test.pdf”, pdfOptions);
final long afterUsedMem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
System.out.println("after Used memory: " + (afterUsedMem) / (1024 * 1024));

The size of tested dxf file: 4.6MB
The memory usage: ~200MB

Is there anyway to optimize (reduce) memory usage?


#2

@yongshao,

I have observed your comments. I like to inform that it depends on amount of entities in file, 4.6 MB - it is a really big drawing and contains lots of data that’s why it is taking such amount. I have logged an issue with ID CADJAVA-393 in our issue tracking system to investigate and resolve issue. This thread has been associated with this ticket so that you can be automatically notified as soon as this issue is resolved.