We recently attempted an upgrade to Aspose.Slides 20.10 (Java). We found it stable for Linux and Windows, but found it to cause a lot of out-of-memory problems when running on macOS. For example:
java.lang.OutOfMemoryError: Java heap space
at com.aspose.slides.internal.e7.void.setCapacity(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.internal.e7.void.b(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.internal.e7.void.write(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.internal.m8.if.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.internal.l0.try.if(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.internal.e5.new.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.internal.n2.implements.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.internal.n5.final.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.internal.n5.final.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.internal.n5.final.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.FontsLoader.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
at com.aspose.slides.FontsLoader.loadExternalFonts(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
Presently, with 20.10, we are only able to run our software stably on macOS if we use a heap exceeding 8GB; this seems like a significant amount of memory just for fonts. When executing FontsLoader.loadExternalFonts, we notice that on Windows the standard font directory (e.g, C:/Windows/Fonts) consumes about 384MB on disk. However, on macOS, the standard font directories (e.g., /System/Library/Fonts/Supplemental, /System/Library/Fonts, etc.) cumulatively exceed 700MB on disk.
If we revert to a previous version of Aspose.Slides (e.g., 20.2), we do not need 8GB heap space on macOS.
This seems like a clear regression, and we cannot expect consumers of our software to assign 8GB+ to heap. Can we expect this regression to be resolved in 20.11?
There has been a similar thread shared by you recently as well. We may need to investigate this and for this we will request you to please share Java details, Source presentation and used sample code. We will add the issue in our issue tracking system to further investigate and resolve the issue.
This particular issue doesn’t require source data. And this issue is unrelated to our other ticket.
As clearly stated above, just call FontsLoader.loadExternalFonts on macOS with some of the font directories mentioned. You should find that when the font directories cumulatively exceed 700MB you’ll encounter OOM exceptions unless you bump xmx really high.
I have create an issue with ID SLIDESJAVA-38350 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
We tried version 21.1. We ran into OOM errors again; our developers and users are requiring questionably large heap sizes in order to load macOS’s font directories.
Please re-open this ticket and fix it properly this time.
java.lang.OutOfMemoryError: Java heap space
at com.aspose.slides.internal.fs.void.toArray(Unknown Source) ~[aspose-slides-21.1-jdk16.jar:21.1]
at com.aspose.slides.internal.mv.try.if(Unknown Source) ~[aspose-slides-21.1-jdk16.jar:21.1]
at com.aspose.slides.internal.fq.new.do(Unknown Source) ~[aspose-slides-21.1-jdk16.jar:21.1]
at com.aspose.slides.internal.on.implements.do(Unknown Source) ~[aspose-slides-21.1-jdk16.jar:21.1]
at com.aspose.slides.internal.oq.final.do(Unknown Source) ~[aspose-slides-21.1-jdk16.jar:21.1]
at com.aspose.slides.internal.oq.final.do(Unknown Source) ~[aspose-slides-21.1-jdk16.jar:21.1]
at com.aspose.slides.internal.oq.final.do(Unknown Source) ~[aspose-slides-21.1-jdk16.jar:21.1]
at com.aspose.slides.FontsLoader.do(Unknown Source) ~[aspose-slides-21.1-jdk16.jar:21.1]
at com.aspose.slides.FontsLoader.loadExternalFonts(Unknown Source) ~[aspose-slides-21.1-jdk16.jar:21.1]
Can you please share the heap size that you are considering higher and that is proving to avoid exception. Please also share that what heap size you are using to reproduce the OOM exception.
Thanks. It’s a clear regression; the problem is not evident, in version 20.2, for example. Perhaps fonts should be loaded on demand, rather than attempting to hold every single font in memory.
To be clear, using the provided directories mentioned above on the same Mac, we have no problems with 20.2, but encounter OOM errors with with 21.1. With either version of Aspose Slides we’re providing the same font paths / same fonts.
We have addressed the issue in upcoming version of Aspose.Slides for Java 21.2 and have shared the pre-release version (https://drive.google.com/file/d/1NbdjWhtTNy1u3X_9I0rk5z_ZKL_8E4oY/view?usp=sharing) for your convenience so that you can verify on your end. Please feel free to use that and share the feedback with us.
Thanks. Our build process is quite complex. Is there any chance we can access the preview version from a repo? We’re used to accessing the slides jar with a line in our dependencies.gradle file, e.g.,
@Shimo,
Welcome to our community! Thank you for contacting support.
Please check your results using the latest version of Aspose.Slides. If the issue persists, please create a new forum thread and share/specify the following: