dovecot: imap(root@localhost)<3702>: Error: Mailbox INBOX: mmap(size=352609044) failed with file /var/spool/mail/root/Maildir/dovecot.index.cache: Cannot allocate memory

If you get this error you may assume it is a lack of memory, which it could be, but more likely it is the default memory size of 256M.  The file in this example was about 350M big which of course exceeds the virtual memory limits.

This makes sense in smaller mail servers but if you have large amounts of users or e-mails this limit should be bumped.

Check your default size limit:

doveconf -n | grep -E 'vsz_limit|service imap'

default_vsz_limit = 4 G
service imap-login {

#If you don't see any default size limit then it has defaulted to 256M which is not enough for larger mail servers.

The default will be something like this (even if commented it is still the default or if no default is set)

#default_vsz_limit = 256M

So the total amount of memory consumed by related proceses by dovecot cannot exceed this.  

To fix it, uncomment and change 256M to a much larger number like 2048M or 20048M etc.., as long as your server has enough memory to support it.

set default_vsz_limit in dovecot.conf

default_vsz_limit = 4096M

In newer versions of Dovecot usually the /etc/dovecot/conf.d files are ignored:

/etc/dovecot/conf.d/10-master.conf

 


Tags:

dovecot, imap, localhost, mailbox, inbox, mmap, var, spool, maildir, index, cache, allocate, memoryif, default, exceeds, virtual, servers, amounts, users, mails, bumped, etc, conf, commented, default_vsz_limit, consumed, proceses, exceed, uncomment, larger, server,

Latest Articles

  • Virtualbox VBox Guest-utils drag and drop files stops working with Windows VMs
  • How To Remove Ubuntu Netplan and Go Back to /etc/network/interfaces
  • How To Force Flash an AMD Instinct GPU To Another Model Using Debian Ubuntu Mint Linux
  • How To compile ollama from source to use unsupported AMD GPU with rocm in Ubuntu Debian
  • QEMU KVM Virtio GPU Windows Cannot Select 1080P
  • Linux Gnome Desktop Ubuntu Mint Debian Gets Slower After Weeks
  • Firefox How to Save Full Page As Screenshot/PDF
  • Nvidia Datacenter Driver Tesla Slow nvidia-smi response and high utilization with 0 usage
  • ffmpeg how to normalize / increase the volume of your audio
  • kdenlive audio blips pops cracks artifacts solution fix
  • haproxy / nginx certbot SSL issues
  • nginx how to see the real IP when behind a CDN
  • Docker how to find real container child process ID
  • Alibaba Aliyun how to reset password solution 'Setup does not meet the requirements, please resetting'
  • RTL88X Series 80Mhz hostapd mode for Linux Debian Kali
  • How To Deploy Your Own Mastodon Server in Docker
  • ffmpeg burning subtitles in non-English errors [Parsed_subtitles_0 @ 0x561d3a0b3b80] Glyph 0x6709 not found, selecting one more font for (Sans, 700, 0)
  • rsyslog in container config
  • Interesting Whisper AI CPU vs GPU Test
  • How to install pytorch with cuda capability for AI acceleration with Nvidia Tesla etc.. GPUs