1752579 Members
4026 Online
108788 Solutions
New Discussion юеВ

"Not enough space" Error

 
SOLVED
Go to solution
ShivS
Frequent Advisor

"Not enough space" Error

Hi Experts:

I am getting error "Not enough space" while mmap'ing a few binary files of very small sizes.

Following are the details of the machine I am getting the "Not enough space" error:

$uname -a
HP-UX ocpdev1 B.11.11 U 9000/800 ocpdev1 unlimited-user license

Following are some of the kernel parameters (output from kmtune):
Parameter: maxdsiz
Current: 1073741824
Planned: 1073741824

Parameter: maxdsiz_64bit
Current: 8589934592
Planned: 8589934592

Parameter: maxfiles
Current: 260
Planned: 260

Parameter: maxfiles_lim
Current: 1024
Planned: 1024

Parameter: maxssiz
Current: 134217728
Planned: 134217728

Parameter: maxssiz_64bit
Current: 268435456
Planned: 268435456

Parameter: maxtsiz
Current: 134217728
Planned: 134217728

Parameter: maxtsiz_64bit
Current: 0x40000000
Planned: 0X40000000

Output of ulimit:
--------------------
$ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) 4194303


I am using the following compilation/linking flags:
aCC -g -Wl,+n,-a,archive -D_HPUX_SOURCE +DA2.0W


Following is some information when I try to run the program using gdb.
$ gdb compile_ocp_contact
Detected 64-bit executable.
Invoking /opt/langtools/bin/gdb64.
HP gdb 5.1.1 for PA-RISC 2.0 (wide), HP-UX 11.00
and target hppa2.0w-hp-hpux11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 5.1.1 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
(gdb) set heap-check on
(gdb) set heap-check leaks on

(gdb) info heap
Heap analysis is not enabled now.
(gdb) info leaks
Leak detection is not enabled now.
(gdb) info corruption
Heap analysis is not enabled now.


(gdb) run
Starting program: compile_ocp_contact ./ ocp_contact.rpt
warning: Your program seems to override the C library functions.
warning: This behavior is not supported yet for this platform !
0~03/19/2009 16:38:44~compile_ocp.cc:182~Bin file of size 80584 bytes to be mapped: ocp_city.offset.bin
1~03/19/2009 16:38:44~compile_ocp.cc:182~Bin file of size 2032 bytes to be mapped: ocp_country.offset.bin
2~03/19/2009 16:38:44~compile_ocp.cc:182~Bin file of size 5192 bytes to be mapped: ocp_province.offset.bin
3~03/19/2009 16:38:44~compile_ocp.cc:182~Bin file of size 80584 bytes to be mapped: ocp_city.offset.bin
4~03/19/2009 16:38:44~compile_ocp.cc:189~Error mmapping the file ocp_city.offset.bin
5~03/19/2009 16:38:44~compile_ocp.cc:190~Reason: Not enough space
6~03/19/2009 16:38:44~compile_contact.cc:705~get_bin_offset_tbl error: Not enough space

Program exited with code 01.
(gdb) info heap
Internal error : Unable to update __rtc_bounds_or_heap!
(gdb) info corruption
Internal error : Unable to update __rtc_bounds_or_heap!
(gdb)


Can anybody please explain what could be the problem here? Note that the memory in the machine is around 32Gigs.

Thanks in advance!

-Shiv
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor
Solution

Re: "Not enough space" Error

Hi:

ENOMEM errors for mmap() point to insufficient data space (the 'maxdsiz' kernel fence). Since your process is a 64-bit one, 'maxdsiz_64bit' may be too low.

It would be useful, too to examine the swap utilization at the time the process is started as insufficient swap space may also contribute to this error.

Regards!

...JRF...
ShivS
Frequent Advisor

Re: "Not enough space" Error

Hi JRF,

Currently,
Parameter: maxdsiz_64bit
Current: 8589934592
Planned: 8589934592

Here's swapinfo:
$ swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 0 8192 0% 0 - 1 /dev/vg00/lvol11
dev 8192 0 8192 0% 0 - 1 /dev/vg01/lvol12
dev 16384 0 16384 0% 0 - 2 /dev/vg01/lvol17
reserve - 20692 -20692
memory 28019 5477 22542 20%
total 60787 26169 34618 43% - 0 -


Note that the program is really very simple and is exiting after mmap()ing 2-3 files.

Any help appreciated.

Thanks
Shiv
Dennis Handly
Acclaimed Contributor

Re: "Not enough space" Error

>Note that the program is really very simple and is exiting after mmap()ing 2-3 files.

It would be helpful for you to provide the mmap options. You should be specifying NULL for addr and MAP_VARIABLE.
ShivS
Frequent Advisor

Re: "Not enough space" Error

Hi Dennis,

This is the command:
mmap((caddr_t)0, bin_file_sz, PROT_READ, MAP_SHARED, fd, 0);

I found the problem. However, I still dont know why the problem is happening.

As per my code requirement, I am suppose to mmap the same binary file twice. Since the address (first parameter) is 0, this should ideally work. However, twice mmaping of the same file was causing the problem. When the second mmaping of the same file, everything worked fine.

Any ideas why this could happen. Why is it not possible to mmap the same file twice?

Thanks!
Shiv.
ShivS
Frequent Advisor

Re: "Not enough space" Error

>> When the second mmaping of the same file, everything worked fine.

Sorry, please read the above line as:

When the second mmaping of the same file was removed, everything worked fine
Dennis Handly
Acclaimed Contributor

Re: "Not enough space" Error

>Why is it not possible to mmap the same file twice?

You can't. They may have fixed this on 11.31.
Have you tried ORin in MAP_VARIABLE?
Venkatesh BL
Honored Contributor

Re: "Not enough space" Error

This is MAP_SHARED. You cannot mmap() the same file twice. What are you trying to accomplish?