a large amount of+~JF * *.tmp files is generated in the hard drive.

Stimulsoft Reports.JAVA discussion
simon ren
Posts: 80
Joined: Wed Nov 21, 2018 12:51 am

a large amount of+~JF * *.tmp files is generated in the hard drive.

Post by simon ren »

Hello,
Currently, when using the printing function, a large amount of+~JF * *.tmp files is generated in the hard drive.
After searching online, we found that it was caused by the use of the Font. createFont() method internally when we called your StiFontCollection. addResourceFont() method.
Font CreateFont() has another method that does not generate a large number of tmp files
Previously, tmp files were automatically cleaned up after the program ended, but now they are not automatically cleaned up
Could you please consider whether to optimize it
Attachments
1[HGLEQTAJU)RVLOY[G}RTC.png
1[HGLEQTAJU)RVLOY[G}RTC.png (78.91 KiB) Viewed 809 times
X]{IRH]VX[RPL[B%AXT`I5X.png
X]{IRH]VX[RPL[B%AXT`I5X.png (122.96 KiB) Viewed 809 times
)W0NC`87GW{[`2)KO[7Q$}V.png
)W0NC`87GW{[`2)KO[7Q$}V.png (743.74 KiB) Viewed 809 times
Max Shamanov
Posts: 824
Joined: Tue Sep 07, 2021 10:11 am

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Post by Max Shamanov »

Hello,

Could you please send us a sample project that reproduces the issue?

Thank you.
simon ren
Posts: 80
Joined: Wed Nov 21, 2018 12:51 am

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Post by simon ren »

Hello,
In a Linux environment,We call StiFontCollection.addResourceFont() method will cause this issue to stabilize.
It will write files to the/tmp folder, and when called multiple times, this folder will be full
Vadim
Posts: 372
Joined: Tue Apr 23, 2013 11:23 am

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Post by Vadim »

Hello.

It seems that is bug of some Java versions, you can change Java version on your Linux environment to fix it.
simon ren
Posts: 80
Joined: Wed Nov 21, 2018 12:51 am

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Post by simon ren »

The problem is that you used the Font. createFont() method, which can also be directly searched online
Vadim
Posts: 372
Joined: Tue Apr 23, 2013 11:23 am

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Post by Vadim »

Hello.

This method load fonts from report resources, if you don't need this font you can remove it from report.
simon ren
Posts: 80
Joined: Wed Nov 21, 2018 12:51 am

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Post by simon ren »

This method has another usage that won't generate a large number of files. Can you consider optimizing it
Vadim
Posts: 372
Joined: Tue Apr 23, 2013 11:23 am

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Post by Vadim »

Hello.

We don't create .tmp files, it created by some Java versions, please change Java version to eliminate problem
simon ren
Posts: 80
Joined: Wed Nov 21, 2018 12:51 am

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Post by simon ren »

Hello,
From the figure, it can be seen that the file was generated in the method chain being called

There are two methods for createFont,
1.Font.createFont(Font.TRUETYPE_FONT, InputStream input);
2.Font.createFont(Font.TRUETYPE_FONT, new File(pathString));

The first one will cause the problem, and the second one will not. Can we change it to the second one
Attachments
S{%@7@GPO$(`6C_KOU_(`ZF.png
S{%@7@GPO$(`6C_KOU_(`ZF.png (91.06 KiB) Viewed 606 times
LKEN3P@S[_$%I9)E5)35`6A.png
LKEN3P@S[_$%I9)E5)35`6A.png (103.92 KiB) Viewed 606 times
_E(K}~RUODY[XTWSXQ7M(QN.png
_E(K}~RUODY[XTWSXQ7M(QN.png (106.08 KiB) Viewed 606 times
Vadim
Posts: 372
Joined: Tue Apr 23, 2013 11:23 am

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Post by Vadim »

Hello.

For our needs createFont with InputStream is necessary
Post Reply