mcimadamore commented 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.
   
   [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-unsubscr...@lucene.apache.org

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



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

Reply via email to