JDK-8267605 : JavaFX temporary font files are not always deleted
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: openjfx16
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2021-05-18
  • Updated: 2021-05-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Windows 10 x64, Java 15.0.2, JavaFX 16, IntelliJ 2020.3

A DESCRIPTION OF THE PROBLEM :
A few days ago for some reason I don't remember I opened the folder "AppData\Local\Temp" and I found out it was flooded with files names like this "+JXF(a series of numbers).tmp". (There were almost 170,000 files for a total size of about 10��GB)
Later on I learned they are temporary files generated by JavaFX.
The problem is that they are not deleted if the JVM process is force closed. I noticed that in IntelliJ if I close the window normally, by using the window's button, the files are deleted upon exit. However, if the app is closed with IntelliJ's stop button the files are not deleted.
This is a big problem, if you don't know this problem you end up with a large part of the disk occupied by temporary files.

Side note: the same thing happens if the SceneBuilder process is killed

I think JavaFX should check if there are already temporary files leftovers and delete them before generating new ones

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Setup a little example, open the"AppData\Local\Temp" folder and start the app. Force close the app with a process manager or with the IDE stop button (tested only with IntelliJ)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The old temporary files should always be deleted even if the process is killed
ACTUAL -
The temporary files will flood the temp folder eventually, occupying a lot of disk space

FREQUENCY : always



Comments
To have lots of these files you must be using this functionality very intensively and shutting down abnormally very frequently. > However, if the app is closed with IntelliJ's stop button the files are not deleted. I wonder what this does ? On any normal shutdown the files should be cleaned up. If you kill -9 the process / terminate from task manager without the opportunity to clean up I have no idea what we could do.
27-05-2021

I see this on Linux, too, so it's not just a Windows-specific problem.
24-05-2021

I can confirm this bug: I also frequently see leftover `+JXF*.tmp` files in tmpdir.
24-05-2021