mmap is failing. Is there a setting to correct this.
I have a new linux mint system with 32 GB of ram.
The following program fails with message commit failed i=32758 However if I try to allocate 16 GB directly it succeeds. Is there a limit on the number of mmapped pages and where can I increase this limit. I am using something like below to allocate a separate page for each pointer in my program followed by a non committed page so that I can track down a buffer overflow in my program. So I need to do separate commits and not allocate a single 16 GB block. Code:
#include <stdio.h> |
I ran across this:
http://www.enchantedage.com/node/235 This indicates the limit is in /proc/sys/vm/max_map_count On my system (I have only 8GB ram), the default value is 65530. You should be able to change the limit permanently in sysctl.conf (parameter would be vm.max_map_count) BTW, just a nit, but index "i" is declared to be an int, yet in the format you used it is treated as unsigned int. |
It worked.
Thank you jpollard. You are such a great help. Thanks for the nit also. |
All times are GMT -5. The time now is 06:01 PM. |