disable imageIO disk cache for better performance?

Description

watching Lucee run thru it's tests with process monitor, I noticed a large number file accesses like

C:\Users\zacsp\AppData\Local\Temp\imageio2505829109277931243.tmp

there is an option to disable this, which is meant to improve performance

https://docs.oracle.com/javase/7/docs/api/javax/imageio/ImageIO.html#setUseCache(boolean)

As we prefer to be fast, let's add support for LUCEE_IMAGE_USE_CACHE=true to support reverting to the old behavior, i.e, low memory systems, etc etc

Attachments

5

relates to

Activity

Show:

Zac Spitzer 25 June 2023 at 09:54

writing out one byte at a time….

Zac Spitzer 20 February 2022 at 16:10
Edited

regarding setUseCache

here’s what procmon sees with it disabled, 20% less disk activity, roughly 30-35m mb less reads and writes

versus currently enabled, see the users folder where my temp folder is has almost no disk activity

oddly, there are all these paths under c:\test which don't exist?

here you can see why, lucee is searching around to find the location, then imageio afterwards starts making tmp files

Zac Spitzer 20 February 2022 at 15:35

that blog post recommends a slightly different approach to avoid this issue

Zac Spitzer 14 September 2021 at 11:56
Edited

On windows, the temp files are appearing in C:\lucee\tomcat\lucee-server with jdk 11.0.7 Tomcat and 5.3.9.5

they are locked by the tomcat process and thus can’t be deleted, but they do disappear after a few minutes

Pete Freitag 13 September 2021 at 16:54

Some additional info, I tested this on my Mac locally and the temp files are getting cleaned up automatically after a few minutes, but on a Linux Server running same version of Lucee 5.3.7.48 with Java openjdk version 11.0.11 the files are not getting cleaned up automatically.

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Priority

Created 4 March 2021 at 08:53
Updated 25 June 2023 at 09:54