mbthomas added a comment.

  In https://phab.mercurial-scm.org/D477#7739, @indygreg wrote:
  
  > Do you know what happens with the underlying file descriptor when it is 
memory mapped? If an fd stays open, that could lead to fd exhaustion. This can 
be mitigated by only using mmap for certain files (minimize size, changelog, 
etc). It's something I'd like an answer to before this is queued.
  
  
  The fd remains open.  (Actually, the fd is dup'd and the original one is 
closed.  The dup remains open.)  For this reason I'm going to restrict it to 
changelog and manifest indexes only, as those are the ones that are known to 
grow big.

INLINE COMMENTS

> simonfar wrote in revlog.py:343
> Is there any reason for `mmapread` to not immediately wrap the data in a 
> `util.buffer` for you?

I took it from Jun's original patch, but I think it's simply separation of 
responsibilities. `util.mmapread`'s purpose is to wrap `mmap(... ACCESS_READ)` 
and handle the case where the file is empty, which normally fails.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D477

To: mbthomas, #fbhgext, indygreg, #hg-reviewers, durin42
Cc: quark, durin42, simonfar, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to