Results 1 to 1 of 1
Hi,
i have a library which uses mmap to map big files into memory. At some point, mmap fails with ENOMEM. And from what i understand, mmap uses kernel memory ...
- 02-03-2011 #1Just Joined!
- Join Date
- Feb 2011
- Posts
- 1
mmap running out of memory
Hi,
i have a library which uses mmap to map big files into memory. At some point, mmap fails with ENOMEM. And from what i understand, mmap uses kernel memory which is limited per system (not per process).
I have some questions related to this...
1. How can i know the system limit of memory available to mmap?
I think it is setrlimit(2) with RLIMIT_AS - can you pls confirm if that is true?
2. How can i know the current usage of this memory? I want to fallback to malloc/read as soon as a certain threshold is passed (i.e. 75% of the available memory).
Thanks
Christoph


Reply With Quote