You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/03/31 18:34:13 UTC

[GitHub] [lucene] mcimadamore edited a comment on pull request #518: Initial rewrite of MMapDirectory for JDK-18 preview (incubating) Panama APIs (>= JDK-18-ea-b26)

mcimadamore edited a comment on pull request #518:
URL: https://github.com/apache/lucene/pull/518#issuecomment-1084961727


   > Thanks for your great explanation. Makes a lot of sense.
   > 
   > Do you know if the `MAP_SHARED` flag is set for mapped memory segments? I guess this means that even if I'm opening a few mapped memory segments on the same file (even if they might only have overlapping regions and the segments will grow in size as the file grows) the virtual address space and the loaded pages will be shared when opened in the same `FileChannel.MapMode` (`READ_ONLY`) mode for instance. I also think setting `madivse` for random index accesses in my case would be of advantage, as the main trie index access pattern might be random.
   > 
   > ```
   >        MAP_SHARED
   >               Share this mapping.  Updates to the mapping are visible to other
   >               processes  mapping  the  same  region, and (in the case of file-
   >               backed mappings) are carried through  to  the  underlying  file.
   >               (To  precisely  control  when updates are carried through to the
   >               underlying file requires the use of msync(2).)
   > ```
   
   Hi, IIRC, the SHARED flag should be set - that said, with the foreign API it is also possible to define *custom* memory mapped segments, if some of the defaults picked by the JDK is not suitable. Few months ago I put together a Gist [1] to illustrate that. I have updated that to reflect the new API changes. Perhaps Lucene might, one day, take advantage of this.
   
   [1] - https://gist.github.com/mcimadamore/128ee904157bb6c729a10596e69edffd


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org