最佳答案
I have a program that maps quite a few (100's) of sizable files 10-100MB each. I need them all mapped at the same time.
At the moment I am calling open
followed by mmap
at the beginning of the program, followed by munmap
and close
at the end.
Often I have to adjust the open files limit running ulimit -n
before running the program.
Question is do I actually need to keep the files open, or can I open
mmap
close
do some large data processing then munmap
when I'm finished.
The man pages of mmap
do not seem terribly clear to me on this one.