1821802 Members
3242 Online
109637 Solutions
New Discussion юеВ

Unable to mmap file

 
SOLVED
Go to solution
Joao Rei
Frequent Advisor

Unable to mmap file

Hi,

Our application team is complaining that a Job is aborting with the following message:

Unable to mmap lbl file '/var/opt/VM1/CP/.

.IA/IARESULT (256)': Not enough space

Question is What could be the reasons to unable to mmap the file because there is not enough space?

IA64 11.23

Regards,

Jo├гo Rei
7 REPLIES 7
TwoProc
Honored Contributor

Re: Unable to mmap file

Is /var or if it is a submount, /var/opt full? Does it have enough room to create an mmap file the size that was requested? I'm thinking the problem is exactly what it says, the file system can't create a file that large.
We are the people our parents warned us about --Jimmy Buffett
James R. Ferguson
Acclaimed Contributor

Re: Unable to mmap file

Hi:

Knowing the exact 'errno' always helps. Knowing if you have sufficient swap space; the 'maxdsiz'; a 32-bit as opposed to a 64-bit process; and the 'flags' argument supplied to mmap()' are all important to deducing the reason for failure.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Unable to mmap file

You really need to learn how to read the UNIX man pages --- especially the system call man pages. Do a man 2 mmap and you will see what conditions can set errno = ENOMEM (the best match to your observed error description). You developer's should be encouraged to include the actual errno value in their error messages. I prefer that over even the standard strerror function because the numerical value leaves no room for doubt. In any event, if I can infer that in your case, mmap() set errno = ENOMEM (12) then there are 2 conditions that will trigger it. 1) The maximum per-process memory limits (maxdsiz / maxdsiz_64bit) have been reached or 2) Not enough virtual memory (more swap is needed).
If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: Unable to mmap file

>.IA/IARESULT (256)': Not enough space

You are either out of swapspace or out of shared memory, depending on how you mapped it.
See comments by JRF and Clay.

>TuProc: Is /var or if it is a submount, /var/opt full?

mmap on a file has nothing to do with file system space.
Dennis Handly
Acclaimed Contributor

Re: Unable to mmap file

>ME: mmap on a file has nothing to do with file system space.

I meant it has nothing to do with exceeding file system space. It seems you would get EOVERFLOW if asking for more than was there. (Possible ENXIO too?)

I'm not sure what happens with a sparse file that is mapped and needs to allocate file space? Whether it is on the mmap(2) or the msync(2)?
Joao Rei
Frequent Advisor

Re: Unable to mmap file

Thanks for the replies.

The mmap function beeing used:

mmap (0, size, PROT_READ | PROT_WRITE,
MAP_FILE | MAP_SHARED , fildes , 0)

I've increased:

maxdsiz 4294963200
maxdsiz_64bit 17179869184

swapinfo -tam shown me no lack of swap.

Still hapenning.

shmmax seems high enough, (kcusage).

Any more ideias?

Thanks.
Don Morris_1
Honored Contributor
Solution

Re: Unable to mmap file

If this is a MAP_SHARED mmap, maxdsiz doesn't mean anything. Reduce it.

Being MAP_FILE, swap reservations also don't come into play -- there's no swap involved here [the file backs the mapping, not swap blocks].

Is this a 32-bit or 64-bit binary? Is there any use of mlock() or mlockall()?

Assuming you aren't really running out of lockable memory, your most likely culprit is that you are 32-bit and you are simply out of suitable shared address space in the default Memory Window [or "size" is above 1Gb in the above sample]. This can be due to shared address space fragmentation or simply having too many other applications running which also create shared objects. Best likely way to tell would be to pick up shminfo and see what's in your quadrants. There's a link in this message: http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1089977