we when live today in production uses aspose cells ( and word, pdf, slides) to convert files to pdfs and images. We had a LOT of OutOfMemory problems. Doing a Google search brings up 100’s pf threads about this subject, and supports answer is always ‘increase the heap’. We’re running at 1.5 GB and experience plenty of OOM exceptions. Unfortunatley we don’t have any further space to increase.
However what is bothering me is the fact that its not releasing the memory at all. If you look at this screen shot attached you can see the massive increase in residual Used Heap on the server (we loaded the library today). The server is currently inactive but its still holding onto 1GB of memory and the garbage collection does not clean it up.
I understand that aspose uses a lot of static caches to optimize, however the problem here is either: a) aspose code is causing a memory leak b) it caching way too many objects
How are we using aspose? a simple REST webservice that returns the location on disk of the PDF file genereated or image (there is no session). Example of code:
com.aspose.cells.Workbook bookd = new com.aspose.cells.Workbook("/locatioonsik/somefile.xls);
String fileLoc = “somelocation/somefile.xls”;
Presentation pres = new Presentation(fileLoc);
ISlideCollection slides = pres.getSlides();
pageCount = slides.size();
// User defined dimension
int desiredX = WIDTH;
int desiredY = PPT_HEIGHT;
// Getting scaled value of X and Y
float ScaleX = (float) (1.0 / pres.getSlideSize().getSize().getWidth()) * desiredX;
float ScaleY = (float) (1.0 / pres.getSlideSize().getSize().getHeight()) * desiredY;
// Access the slide
ISlide sld = slides.get_Item(page);
// Create a full scale image
BufferedImage image = sld.getThumbnail(ScaleX, ScaleY);
// Save the image to disk in JPEG format
ImageIO.write(image, “png”, new File(“result.png”));
So this is pretty critical as its effecting us now in production. What can we do? There are 1000’s of different files being used, so I cannot send you an example file.
I have observed the issue shared by you. However, I am unable to load the attachment on my end. Can you please share the attachment again with us. As far as your explanation of the issue is concerned, I request you to please provide tangible information in the form of sample presentation, source code used, application type, Operating System details, Java details and statistics achieved. We really wish to address your issue but need the above mentioned information so that we may be able to investigate the issue on our end. Please also share the detailed information for the fact of memory leak as well. Please share the requested information so that I may help you further in this regard.