-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
12.1.0 - Allow configuring minimum size before File Mapped Buffers are used. #12701
Comments
If no objections, I would like to support on solving of this issue. |
Please assign it to me. Thank you! |
done. Feel free to propose a PR. Thanks! |
I'm wondering what is I did a benchmark tests in
Here is a sample of the benchmark method:
Result is:
By the way, it is not possible to map a region which size is greater than So, question: is it worth to implement this feature? |
Jetty version(s)
12.1.0
Enhancement Description
There are several places we use the FileChannel.map() feature to load File as a memory mapped ByteBuffer.
The javadoc for this method indicates the following memory concern ...
"For most operating systems, mapping a file into memory is more expensive than reading or writing a few tens of kilobytes of data via the usual read and write methods. From the standpoint of performance it is generally only worth mapping relatively large files into memory."
The enhancement is that there should be a configurable minimum size before a memory mapped ByteBuffer is used, vs a normal ByteBuffer from typical file I/O operations.
Discovered as part of issue #12695
The text was updated successfully, but these errors were encountered: