Hello,
Hi Simon,
Hi Simon,
Hi Nayyer,
Hi Tahir,
Hi Simon,
- OS (Windows Version or Linux Version)
- Architecture (32 / 64 bit)
- Java version
- Provide information about your specific culture, such as the name of the culture, language and country/region.
- Please supply us with the code from your application that is causing the issue
- Please supply us with the input document that is causing the issue
ENTITLEDIRECT:
I don’t have a straight answer to your question. There is no a particular piece of code that causing this. We have ~200 users in our system, OutOfMemory happens when they start using aspose features. Merging multiple files used most often.
I rolled back to aspose-pdf-kit-4.3.0.jar and the memory issue is gone. So I’m sure that that issue is with concatenating multiple files in aspose.pdf-new-4.1.2.jar
…PdfFileEditor outfile = new PdfFileEditor();ArrayList instreams = new ArrayList();for (String id : documentsToProccess) {
}…Document d = new Document(filename);ByteArrayOutputStream tmpBuffer = new ByteArrayOutputStream();d.save(tmpBuffer,SaveFormat.PDF);instreams.add(new ByteArrayInputStream(tmpBuffer.toByteArray()));
InputStream streams[] = new InputStream[instreams.size()];
instreams.toArray(streams);
outfile.concatenate(streams, outbuffer);
…
ENTITLEDIRECT:
I rolled back to aspose-pdf-kit-4.3.0.jar and the memory issue is gone. So I'm sure that that issue is with concatenating multiple files in aspose.pdf-new-4.1.2.jarSame code work fine with old jar, and give OutOfMemoryError with new jar, when users start using this feature in the morninghere is how we use it:....PdfFileEditor outfile = new PdfFileEditor();ArrayList instreams = new ArrayList();for (String id : documentsToProccess) {}...Document d = new Document(filename);ByteArrayOutputStream tmpBuffer = new ByteArrayOutputStream();d.save(tmpBuffer,SaveFormat.PDF);instreams.add(new ByteArrayInputStream(tmpBuffer.toByteArray()));InputStream streams[] = new InputStream[instreams.size()];instreams.toArray(streams);
outfile.concatenate(streams, outbuffer);....
Hi Simon,
The problem is that when we try to use new pdf JAR (please refer to previous posts for exact version), this code eventually cause OutOfMemoryError, it usually takes an hour in the morning when users start actually using the system , which imho suggests either memory leak or loading to many data into the memory.
Hi Simon,
com.aspose.pdf.facades.PdfFileEditor outfile = new com.aspose.pdf.facades.PdfFileEditor();<o:p></o:p>
ArrayList instreams = new ArrayList();
// specify the folder from which DOC files will be retrieved
java.io.File folder = new java.io.File("C:\\pdftest\\Giflogos\\");
// get the list of files present in particualr folder
java.io.File[] listOfFiles = folder.listFiles();
// itterate through each doc file
for (java.io.File file : listOfFiles) {
// print doc file name being processed
System.out.println(file);
com.aspose.words.Document d = new com.aspose.words.Document(file.getAbsolutePath());
ByteArrayOutputStream tmpBuffer = new ByteArrayOutputStream();
d.save(tmpBuffer,com.aspose.words.SaveFormat.PDF);
instreams.add(new ByteArrayInputStream(tmpBuffer.toByteArray()));
}
InputStream streams[] = new InputStream[instreams.size()];
instreams.toArray(streams);
outfile.concatenate(streams, new ByteArrayOutputStream());