GroupDocs.Viewer issue with font file descriptor leak

We have bought the GroupDocs.Viewer product and are using it in one of our microservices to preview office /pdf documents.
It appears that that the product leaves a lot of font file descriptors open, marked as deleted.
We investigated similar issues found, but did not come to a concrete resolution.

We identified the issues with using java.awt.Font.createFont(inputstream) that could lead to leaks and tried using -Dsun.java2d.font.reftype=weak but did not resolve our issue.

Do you have any recommendation on how to properly manage the leaked font files and properly deleted them, without resulting to JVM restarts?

Thank you beforehand

Details.
Java version 1.8.0_421
GroupDocs version 24.4
Deployed on Weblogic 12c

1 Like

@mmalamic
Hello!

Thank you for purchasing our product.

You can use the clearAllTempFiles() method from the com.groupdocs.viewer.utils.MemoryCleaner class to clean up temporary files.

@aleksey.permyakov thank you for your reply. apparently the MemoryCleaner just removes temp files. But the fonts (we identified to trueType) for PDF keep on increasing and even if marked as deleted they were not removed.

instead of this we applied to render PDF as image and of course fixed the issues as we dont use any fonts.

I would ask though, as we have seen that plenty of these incidents have happened with groupDocs and aspose, if you reached a conclusion about handling these leaked font file descriptors, except restart the JVM that is.

thank you as always beforehand for your actions.

@mmalamic I have created an issue with ID VIEWERJAVA-3716. I will investigate the problem further. If you could share the files you used to reproduce the issue, it would be helpful.