Hi,
We have a test suite which has testcases for our API’s which uses Aspose.Slides API extensively.
This test suite was consuming 1.536 MB with version Aspose.Slides Java 15.3.0 and its consuming 2.7 GB with version Aspose.Slides Java 15.6.0.
In order to investigate further, we tried following test case which is just loading and saving the PowerPoint presentation.
public class TestMemory{
Memory memory=new Memory();
public void testMemoryUsage() {
long usedMemory = 0;
memory.baseline();
Presentation pres =new Presentation (“LloydsFinancialResultspresentation2004.pptx”);
usedMemory = memory.checkUsage();
System.out.println("15.6.0 Memory Used in loading: " + usedMemory);
memory.baseline();
pres.save(“LloydsSaved.pptx”, SaveFormat.Pptx);
usedMemory = memory.checkUsage();
System.out.println("15.6.0 Memory Used in Saving " + usedMemory);
}
}
public class Memory {
private static final int NUM_TIMES_TO_RUN_GC = 30;
private static final long INITIAL_BASELINE_VALUE = -1L;
private long baseline = INITIAL_BASELINE_VALUE;
public void baseline() {
baseline = runCheck(NUM_TIMES_TO_RUN_GC);
}
public long checkUsage() {
Validate.isTrue(baseline >= 0, “Please make suer Memory.baseline() is called first!”);
// Calculate the difference
final long usage = runCheck(NUM_TIMES_TO_RUN_GC) - baseline;
// Initialize the baseline.
baseline = INITIAL_BASELINE_VALUE;
return usage;
}
private long runCheck(int numGcs) {
for (int times = 0; times < numGcs; times++) {
System.gc();
}
long freeMemory = 0;
long totalMemory = 0;
for (int count = 0; count < 4; count++) {
freeMemory = Runtime.getRuntime().freeMemory();
totalMemory = Runtime.getRuntime().totalMemory();
}
return totalMemory - freeMemory;
}
}
We tried above code with both the versions Aspose.Slides Java 15.3.0 and Aspose.Slides.Java 15.6.0 and got following result.
15.6 is using 75 MB(approximate) memory more for loading this presentation when compared to 15.3.0.
Infact, for some PowerPoint presentations, 15.6.0 is using 100MB more than 15.3.0 just for loading the PowerPoint.
Sample PowerPoint presentation attached with this post.
Please consider it a high priority issue and kindly look into this as soon as possible.
Thanks
Manisha
Hi Manisha,
It’s Oracle Linux 5 (Intel 64-bit).
Hi Manisha,
Hi,
Sorry, we can not share our sample application with you.
The JDK details are given below :
java version “1.7.0_72”
Java™ SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot™ 64-Bit Server VM (build 24.72-b04, mixed mode)
I came across one more post at Aspose forum which reported high memory consumption.
Memory Usage (Again)
I want you to monitor the memory consumption in Aspose Slides Java 15.6.0 version.
You can also compare the memory consumption with Aspose Slides Java previous version.
Thanks
Manisha
Hi Manisha,
Hi Manisha,
Hi Manisha,
Hi,
Could you please share the memory consumption statistics with Aspose.Slides.Java 15.6.0? Also share the environment where you are running this code.
Our memory statistics are given below:
15.3.0 Memory Used in loading: 98488472
15.3.0 Memory Used in Saving -1661728
15.6.0 Memory Used in loading: 173740688
15.6.0 Memory Used in Saving 547336
Environment: Oracle Linux 5 (Intel 64-bit).The JDK details are given below :java version "1.7.0_72"
Java™ SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot™ 64-Bit Server VM (build 24.72-b04, mixed mode)
</blockquote></blockquote></blockquote></blockquote>According to the statistics shared by you, it seems that Aspose.Slides.Java 15.7 is taking more memory than Aspose.Slides.Java 15.6.<br>As per the memory snapshot shared by you, Aspose.Slides.Java<b> 15.7</b> is taking <br><b>239.824152 MB </b>to load the sample presentation, on the other hand, as per our findings Aspose.Slides.Java <b>15.6</b> is taking <b>173.740688 MB</b> to load same sample presentation.<br>From this, it seems that Aspose.Slides.Java 15.7 is consuming 66MB more than Aspose.Slides.Java 15.6.<br><br><br>Thanks<br>Manisha<br><br>
Hi,
Could you please share the memory consumption statistics with Aspose.Slides.Java 15.6.0? Also share the environment where you are running this code.
Our memory statistics are given below:
15.3.0 Memory Used in loading: 98488472
15.3.0 Memory Used in Saving -1661728
15.6.0 Memory Used in loading: 173740688
15.6.0 Memory Used in Saving 547336
Environment: Oracle Linux 5 (Intel 64-bit)
java version "1.7.0_72
Java™ SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot™ 64-Bit Server VM (build 24.72-b04, mixed mode)
</blockquote>According to the statistics shared by you, it seems that Aspose.Slides.Java 15.7 is taking more memory than Aspose.Slides.Java 15.6.<br>As per the memory snapshot shared by you, Aspose.Slides.Java<b> 15.7</b> is taking <br><b>239.824152 MB </b>to load the sample presentation, on the other hand, as per our findings Aspose.Slides.Java <b>15.6</b> is taking <b>173.740688 MB</b> to load same sample presentation.<br>From this, it seems that Aspose.Slides.Java 15.7 is consuming 66MB more than Aspose.Slides.Java 15.6.<br><br><br>Thanks<br>Manisha<br><br>
Hi Manisha,
Hi,
I tested memory consumption on my machine with different versions of Aspose Slides Java 15.3.0 , 15.6.0 and 15.7.0 and got following results:
5.3.0 Memory Used in loading: 98.488472 MB
15.3.0 Memory Used in Saving -1661728
15.6.0 Memory Used in loading: 173.740688 MB
15.6.0 Memory Used in Saving 547336
15.7.0 Memory Used in loading: 155.403520 MB
15.7.0 Memory Used in Saving 1.947752 MB
Environment: Oracle Linux 5 (Intel 64-bit)
java version "1.7.0_72
Java™ SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot™ 64-Bit Server VM (build 24.72-b04, mixed mode)
From the results given above, we can clearly see that 15.7.0 is performing slightly better than 15.6.0 but consuming way more memory than 15.3.0.
I think you still need to focus on memory aspects of Aspose Slides upcoming version. We are hoping that the new version will perform better or at least close to 15.3.0.
We eagerly want to migrate to Aspose Slides new version as it has some fixes but this memory issue hinders this migration.
Thanks
Manisha
Hi Manisha,
Hi Manisha,
The issues you have found earlier (filed as SLIDESJAVA-34977) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.