qpid broker fails to start on store recovery: with error "posix_memalign(): (Cannot allocate memory)"

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 6 or 7
  • Red Hat Satellite 6 or Red Hat Enterprise MRG Messaging 3

Issue

Having a broker with >32000 (on RHEL6) or >64000 (on RHEL7) durable queues does either:

  • fail to start due to critical error "posix_memalign(): alignment=4096 size=1048576 errno=12 (Cannot allocate memory)"
  • or fail to create a new durable queue with error "create() failed: jexception 0x0103 pmgr::initialize() threw JERR__AIO: AIO error. (io_queue_init() failed: errno=11 (Resource temporarily unavailable))".

Resolution

Increase kernel parameter vm.max_map_count. Add to /etc/sysctl.conf:

vm.max_map_count = 655300

Reload the setting by running sysctl -p and try to restart qpidd service.

Learn More


See the [Red Hat Satellite Installation guide](https://access.redhat.com/documentation/en-US/Red_Hat_Satellite/6.1/html/Installation_Guide/sect-Red_Hat_Satellite-Installation_Guide-Prerequisites.html#sect-Red_Hat_Satellite-Installation_Guide-Prerequisites-Large_deployments) for more on considerations for large deployments.

Diagnostic Steps

Qpid logs:

2015-07-12 17:15:38 [Broker] critical Unexpected error: Queue queue_123456: recoverQueues() failed: jexception 0x0100 pmgr::initialize() threw JERR__MALLOC: Buffer memory allocation failed. (posix_memalign(): alignment=4096 size=1048576 errno=12 (Cannot allocate memory)) (/builddir/build/BUILD/qpid-cpp-0.30/src/qpid/linearstore/MessageStoreImpl.cpp:771)
SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.