$RodHat_/search
resource limits reference

RLIMIT_MSGQUEUE

Maximum bytes the real user ID may allocate to POSIX message queues.

Resource number
12
Row in /proc/PID/limits
Max msgqueue size
bash ulimit flag
ulimit -q
Unit in /proc/PID/limits
bytes
Added in Linux
2.6.8
Group
Queues

What happens at the limit

mq_open(3) fails when creating a queue would pass the limit.

It covers POSIX queues (mq_open), not System V msgget queues, which are sized by the msgmnb and msgmax sysctls. Space is charged when the queue is created, based on mq_maxmsg and mq_msgsize plus bookkeeping overhead, and stays charged until the queue is removed.

Check a running process with grep -i "Max msgqueue size" /proc/PID/limits, or paste the whole file into the limits reader. Inspect or change one on a live process with prlimit --pid PID(util-linux).

Sources

  1. getrlimit(2), Linux man-pages
  2. proc_pid_limits(5), Linux man-pages

Resource numbers are from asm-generic/resource.h; a few architectures (Alpha, MIPS, SPARC) number some limits differently. The list of syscall cards is matched by name from the card text on this site, not from the kernel source. Spot one that's wrong? Tell Rod.