Hi,
The code below, in combination with the attached docx file, demonstrates the Aspose memory leak.
Is there an update of the java component? Can this be fixed because we are planning to purchase this component.
Best regards,
Anouar
\ === === === === === === === === === === === === === === === === === === === ===
import java.io.FileInputStream;
import com.aspose.words.Document;
public class AsposeMemoryLeakDemo
{
public static void main(String[] args) throws Exception
{
String inputFileName = "input.docx";
String outputFileName = "output.pdf";
Document inputFile = new Document(new FileInputStream(inputFileName));
for (int i = 0; i <1000; i++)
{
inputFile.save(outputFileName);
System.out.println("Total memory (bytes): " + Runtime.getRuntime().totalMemory());
}
}
}
Thanks for your inquiry. I have tested the scenario with following code snippet and have not found the shared issue while using latest version of Aspose.Words for Java 13.7.0. Please use the latest version of Aspose.Words for Java 13.7.0. Please try the following code snippet at your end with latest version of Aspose.Words and let us know if you still face problem.
String inputFileName = MyDir + "input.docx";
Document inputFile = new Document(new FileInputStream(inputFileName));
for (int i = 0; i <1000; i++)
{
inputFile.save(MyDir + "Out\\output" + i + ".pdf");
System.out.println("Total memory (bytes): " + Runtime.getRuntime().totalMemory());
}
Thanks for your inquiry. I managed to observe a significantly high memory spike during processing/rendering your Word document to many Pdf documents under OpenJDK environment on my side. I have logged a task in our issue tracking system for our development team to investigate the cause of possible memory leaks in Aspose.Words for Java. Your ticket number is WORDSJAVA-770. Your request has also been linked to this task and you will be notified as soon as it is worked out. Sorry for the inconvenience.
does your Word file contain embedded images? I got a problem with documents containing images under the 13.7.0 version as well, but this was fixed with the current 13.8.0. Might be worth a try for you too?
> Have you got any updates regarding this issue ? (WORDSJAVA - 770) *
Unfortunately, your issue is not resolved yet. Our development team has completed the analysis of this issue and the root cause has been identified. We will inform you via this thread as soon as this issue is resolved. We apologize for any inconvenience.
Scherge:
does your Word file contain embedded images? I got a problem with documents containing images under the 13.7.0 version as well, but this was fixed with the current 13.8.0. Might be worth a try for you too?
Thanks for the additional information. It’s great you were able to find what you were looking for. Please let us know any time you have any further queries. We have just released Aspose.Words for Java 13.8.0 here and you’re welcome to give it a try.
Do you have any idea when this issue is going to be resolved? Because we would like to deploy it within a week.
I assume that this issue is still not resolved in 13.8.0?
Right now we are limited to converting only 1000 documents to a pdf, which is basically a small number compared to the 10000 documents we would like to convert.
Thanks for your inquiry. Unfortunately, your issue is not resolved yet. I have also intimated our development team of your concern and asked the ETA for this issue. I will try to get a firm estimate on this issue and provide you some further feedback. We apologize for your inconvenience.
Hi Anouar,
Could you please carefully check if problem still exists in 13.8.0?
I have executed the code you provided on the attached input file using OpenJDK 7 and don’t see any memory leak problems.
I have following console output at the beginning and at the end of execution, respectively:
0 Total memory (bytes): 44658688
1 Total memory (bytes): 44658688
2 Total memory (bytes): 44658688
…
997 Total memory (bytes): 56868864
998 Total memory (bytes): 56868864
999 Total memory (bytes): 56868864