We have a program that maps a file into memory. The command uses mmap and is used like this:
__output_rec = (Mptr) mmap ( 0, ( __max_file_recs + SAFE_BUFFER) * sizeof ( Mnode ), PROT_READ | PROT_WRITE, MAP_PRIVATE, __output_fd, 0 );
The error is:Nov 27 09:50:38 smscp2 MVAS1[11380]: sms_merge_ord.c : create_new_file () : Failed to map file to memory.. 12 : Not enough space
Nov 27 09:50:38 smscp2 MVAS1[11380]: sms_merge_ord.c : main () : Failed to create new file.
We have 8GB physical memory and have around 80% utilization. Based on our calculations the file should only be around 100MB. Do we have a kernel configurable parameter for this?
Note: If you are the author of this question and wish to assign points to any of the answers, please login first.For more information on assigning points ,click
here
The error is due to
1.Amount of memory and swap available.
If you have 80% used.
What is the value of dbc_max_pct on your kernel.
If it is 50% of memory bring it down to somewhere around 8.
The buffer cache half the memory is too high.
check the individual process usage using
UNIX95= ps -e -o ruser,pid,vsz=Kbytes
to check the process usage by each process.
How is the usage of the swap on the machine
Just do a
swapinfo -ta
you can use glance to monitor the process which is throwing out the error.
2.You have to increase your kernel parameters like
These paramters define the upper limit for a process.
They have default values like 8MB.
maxdsiz
maxdiz_64
maxssiz
maxssiz_64
maxtsiz
maxtsiz_64
ALso make sure that you check these values.
I agree with Harry. Look at your dbc_min_pct and dbc_max_pct kernel parameters. You will find that they are set to the default which is 50%. This is just about useless. The ideal value should be somewhere in the vicinity of 300-500Mb no more. So in your case, dbc_max_pct should be set to 5, dbc_min_pct to 2.