IMAP - IOERROR : Cannot allocate memory

Andy Kopciuch akopciuch at bddf.ca
Sun Sep 18 01:15:04 CEST 2016


> Having a look at the source code I think the code generating the error
> is:
> 
> 
> 
>     *base = (char *)mmap((caddr_t)0, newlen, PROT_READ, flags, fd, 0L);
>     if (*base == (char *)MAP_FAILED) {
>         syslog(LOG_ERR, "IOERROR: mapping %s file%s%s: %m", name,
>                mboxname ? " for " : "", mboxname ? mboxname : "");
>         snprintf(buf, sizeof(buf), "failed to mmap %s file", name);
>         fatal(buf, EC_IOERR);
>     }
> 
> 
> This means that the mmap system call is failing.  I would check actual free
> memmory - On my server the imapd process never gets big. But I would start
> looking at overall memory use.
> 
> Cheers
> Chris
> 


Yes,

I found some information eventually, and something in the cyrus release notes 
for version 2.5.1 that there was a memory leak involving mmap that had been 
fixed.

However, kolab 3.4 has the custom cyrus 2.5, and this obviously is not (or 
expected) to be back ported.

This memory leak seems to be trigger when generating a mailboxes database to 
disk when using the twoskip format.   Up until cyrus 2.4, the default format 
for databases was skiplist, and in 2.5 it was changed to twoskip (next gen 
twoskip implementation it seems).

After some investigation, and experimentation I found that I could convert the 
database from twoskip into flat, or skiplist (or other supported formats) with 
the conversion utility.   However ... any conversion from another format 
_into_ twoskip would result in the same mmap error during conversion.

So I solved this by converting mailboxes.db back into the previous skiplist 
format, and changed the config mailboxes_db = skiplist option in imap.conf.

There have been no issues since.


thanks,


Andy


More information about the users mailing list