what is the size limit for mmap

ぃ、小莉子 提交于 2019-12-03 16:00:02
prabhakar palanivel

There is no restriction on mmap size but would depend on the existing address space used by the given process. But it is highly suggested that you dont mmap to a large contiguous virtual address space. Another suggestion would be to use the mmap "just-in-time" when a specific physical address (or a device address) is accessed and unmap once done

/proc/sys/vm/overcommit_memory controls the maximum on Linux

I have explained this in detail at: maximum memory which malloc can allocate

Basically, the value of 1 allows arbitrary virtual allocations, while 0 and 2 have more complicated limit calculations.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!