Aspose words (10.x) works very slow

Sometimes aspose is working very slow on our server it takes more then 50% of CPU.

What it could be?

Hi Alexey,

Thanks for your inquiry. To ensure a timely and accurate response please supply us with the following information, if you cannot supply us with this information we will not be able to investigate your issue and raise a ticket.

  • What version of Aspose.Words for Java are you using? Have you tried Aspose.Words for Java 14.5.0?
  • What environment are you running on?
    • OS (Windows Version or Linux Version)
    • Architecture (32 / 64 bit)
    • Java (SDK) version
    • Any Third Party Libraries / SDK in addition to Aspose APIs.
  • 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

As soon as you get these pieces of information to us we’ll start our investigation into your issue and provide you more information.

Many thanks,

We are using Aspose 10.1.0.0
OS - centos 6.6
Architecture - 64 bit
JDK 1.7.0_25
The application working under Tomcat 7.

Here the code where we have a problem
Document doc = null;
doc = new Document(path);
int size = data.getMergeMap().size();
String[] fields = new String[size + 3];
Object[] values = new Object[size + 3];
int i = 0;
for (String name : data.getMergeMap().keySet()) {
fields[i] = name;
values[i++] = data.getMergeMap().get(name);
}
fields[i] = "title";
values[i++] = title;
fields[i] = "needTable";
values[i++] = needTable ? 1 : 0;
fields[i] = "isDeletedRubric";
values[i++] = isDeletedRubric ? 1 : 0;

List callbacks = getCallbacks(data.getTableDataSource());
if (callbacks != null) {
for (IFieldMergingCallback callback : callbacks) {
doc.getMailMerge().setFieldMergingCallback(callback);
}
}

if (data.getTableDataSource() != null) {
modificateDocument(doc, data.getTableDataSource().getHeaders());
}
doc.getMailMerge().setRemoveEmptyRegions(true);
doc.getMailMerge().setUseNonMergeFields(true);

doc.getMailMerge().execute(fields, values);
if (data.isRelationalData()) {
DataSet ds = prepareDataSet(data);
} else {
TableMailMergeDS rubricsDataSource = data.getRubricsDataSource();
if (rubricsDataSource != null) {

doc.getMailMerge().executeWithRegions(rubricsDataSource);
}
doc.getMailMerge().executeWithRegions(data.getTableDataSource());
}

if (data.getTableDataSource() != null) {
addTotalRow(doc, data);
}
removeFieldByName(doc, data, "");
doc.updateFields();
This problem is appiars when some parallel process is working at rhe same time. When this problem is appiars after that all documents is generating very slowly. And only restarting server helps to improve performance.

I've attached the template for document.

Hi Alexey,


Thanks for the additional information. You are using a very old version of Aspose.Words, we encourage you to use the latest version of Aspose.Words as it contains newly introduced features, enhancements and fixes to the issues that were reported earlier. So, I would suggest you please download the latest version 14.5.0 from the following link. I hope, this helps:
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/default.aspx

Moreover, we are currently not able to reproduce this issue on our end because some bits of code are missing from your shared code (e.g. getCallbacks, modificateDocument, prepareDataSet, removeFieldByName function definitions are missing and there are many unresolved custom classes e.g. TableMailMergeDS, data in your code). We suggest you please create a standalone runnable simple Java application that helps us reproduce the same problem on our end and attach it here for testing. As soon as you get this application ready, we’ll investigate the issue further and provide you more information. Thanks for your cooperation.

Best regards,