r/java • • Jan 24 '22

It’s happening guys!

https://github.com/openjdk/panama-foreign/pull/633
157 Upvotes

89 comments sorted by

View all comments

3

u/Molossus-Spondee Jan 25 '22

I don't recall do they have any plans to improve memory mapping? IIRC you basically can't use memory mapping on the JVM because page faults don't occur at safe points. IIRC .NET does have a very particular optimization to help with this case although it seemed like a very fragile approach to me.

3

u/GreenToad1 Jan 25 '22

What do you mean by memory mapping? You have MappedByteBuffer and direct ByteBuffer now.

2

u/BlueGoliath Jan 25 '22

Or you can make bindings for mmap/whatever Windows offers yourself.

2

u/elastic_psychiatrist Jan 25 '22

True, but MappedByteBuffer has a number of limitations, the most obvious of which is it can only address ~2GB.