It seems that you are experiencing high memory consumption when loading a 17MB PPTX file using Aspose Slides for Java. This can happen due to the way presentations are managed in memory, especially with large files.
To mitigate memory usage, you can utilize the BlobManagementOptions in your LoadOptions. Specifically, setting the PresentationLockingBehavior to KeepLocked allows the presentation to be locked for the instance’s lifetime without loading it entirely into memory. This can help reduce the memory footprint significantly.
Here’s an example of how you can implement this:
LoadOptions loadOptions = new LoadOptions();
loadOptions.getBlobManagementOptions().setPresentationLockingBehavior(PresentationLockingBehavior.KeepLocked);
loadOptions.getBlobManagementOptions().setTemporaryFilesAllowed(true);
loadOptions.getBlobManagementOptions().setTempFilesRootPath(tempDirectory.toString());
loadOptions.getBlobManagementOptions().setMaxBlobsBytesInMemory(512 * 1024 * 1024); // 512MB
Presentation presentation = new Presentation(inputFile, loadOptions);
try {
// Perform operations on the presentation
} finally {
presentation.dispose();
}
By using the KeepLocked behavior, you can work with large presentations while keeping memory usage lower. Additionally, ensure that you dispose of the Presentation object properly to free up resources after you are done.
If you continue to experience issues, consider checking the memory logs you provided to identify any specific areas where memory usage spikes occur. This can help in further optimizing your code.
If you have any more questions or need further assistance, feel free to ask!
If you look more closely to the code example I have posted, you will see that the solution with loadOptions.getBlobManagementOptions(), that you are proposing, is the exactly same code as I am using. It is not helping.
@AlesGregor,
We are sorry that you encountered this problem. We would greatly appreciate it if you could share more details to help us investigate the issue. Please share the following:
sample presentation file
OS version on which the code was executed
JDK target version in your application project
Please also specify the compliance format in the following code line:
I’ve reproduced the problem where converting a PowerPoint presentation to a PDF document consumes more than 1GB of memory.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): SLIDESJAVA-39643
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.