Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge amount of +~JF****.tmp files created in the /tmp folder causing system to crash #608

Closed
sureshkumar-ramalingam opened this issue Nov 25, 2020 · 5 comments

Comments

@sureshkumar-ramalingam
Copy link

I got the same issue created Huge amount of +~JF****.tmp files created in the /tmp folder causing system to crash

image

when I look for the solution, I was navigated to the below link.

https://stackoverflow.com/questions/38783010/huge-amount-of-jf-tmp-files-in-var-cache-tomcat7-temp

Any help will be really appreciated.

@syjer
Copy link
Contributor

syjer commented Nov 25, 2020

hi @sureshkumar-ramalingam , are you using the java2d backend?

I'm not sure the pdfbox backend is calling Font.createFont.

Could you provide the java code and html example that cause this issue?

Thank you.

@sureshkumar-ramalingam
Copy link
Author

Hi @syjer It is the pdfbox backend is calling Font.createFont. We are using a custom font file in the HTML.

Thanks,
Sureshkumar

@syjer
Copy link
Contributor

syjer commented Nov 26, 2020

Could you provide a little bit more information so we could try to reproduce the error?

For example: the html template, the code that you are using for calling openhtmltopdf.

@syjer
Copy link
Contributor

syjer commented Nov 29, 2020

hi @sureshkumar-ramalingam , are you using some svg with text in your html / or simply enabled the svg support?

font = Font.createFont(Font.TRUETYPE_FONT, new ByteArrayInputStream(fontBytes)).deriveFont(toFontWeight(fontWeight) | toStyle(fontStyle) , size);
seems to be the only code that is calling Font.createFont in the non java2d path (https://github.com/danfickle/openhtmltopdf/search?q=Font.createFont&type=code ).

If you could show us the java code that you are using for calling this library and a html it will be simpler for tracking this issue (if this library is the main cause).

@syjer
Copy link
Contributor

syjer commented Nov 29, 2020

Seems the issue is in the svg support (as reported by @olayinkasf in comment #405 (comment)).

I think I can provide a fix by handling manually a cache of temporary files with the "hash" as key, so at least for a given font, there is only one instance. On top of adding support for "File" so we can bypass this handling, I hope, in most cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants