On 16/06/2022 19:58, Thomas Hoffmann (Speed4Trade GmbH) wrote:

<snip/>

In the meantime I stumbled upon this bug-Report: 
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4715154
So maybe the problem lies even deeper.
Similar description here: 
https://cemerick.com/blog/2006/08/30/memory-mapping-files-in-java-causes-problems.html

Some ppl suggest to use java.lang.ref.Cleaner or don’t use Memory-Mapped files 
under Windows.
I don’t know if there are other solutions.

Your research looks to be exhaustive. I can't find any better ideas.

Using the java.lang.ref.Cleaner looks to be a viable option. We know when the mapped file is no longer being used. However, that requires Java 12 onwards.

This is only going to be required if the file locking is an issue. In read-only scenarios or when using an OS other than Windows it won't be an issue.

So, what do we want to do?

1. Disable sendfile for HTTP/2 if running on Windows?

2. Document the potential issues with sendfile + HTTP/2 + Windows if resources are not read-only?

3. Use the JreCompat mechanism to clear the references if possible:
   - if running on Windows
   - on all OSes
   - if enabled via configuration

Something else?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to