3

In my tomcat temp folder, I have 2.5Gb of +~JF****.tmp files, the file sizes are either ~750K or ~23M

$ pwd
/var/cache/tomcat7/temp
$ ls -lt
-rw------- 1 tomcat tomcat 23278008 06:47  5 Th08 +~JF2247741302721424357.tmp
-rw------- 1 tomcat tomcat   773236 06:47  5 Th08 +~JF2626850872018060030.tmp
-rw------- 1 tomcat tomcat   750984 06:47  5 Th08 +~JF6955350201064404318.tmp
-rw------- 1 tomcat tomcat 23278008 06:34  5 Th08 +~JF5760450811263657816.tmp
...

I did you searching for this problem but all I found is about Jasper Report font problem which doesn't make sense to me, my project is not using Jasper.

do you have any idea why?

thanks

Dzung BUI
  • 188
  • 2
  • 9

1 Answers1

3

We are facing a similar problem and I would like to share what I found:

java.awt.Font.createFont(int i, java.io.InputStream in) generates a temporary file with a name +~XXXX.tmp (where XXXX is a long number).

When the JVM ends, all these files are deleted.

The problem arises when the JVM ends abruptly, as it doesn't delete temporary files, or for long-running JVM (i.e.: Tomcat production server).

What we did was just change the font creation method and use:

java.awt.Font.createFont(int i, java.io.File f)

With this method a temporary file is not created anymore.

Oscar Pérez
  • 4,377
  • 1
  • 17
  • 36