slapd cannot allocate memory under load

One way of making OpenLDAP to perform, is to tweak the BDB/HDB backend to use a big in memory cache. However, you may experience this problem if you crank it up too high and set the server under heavy load:

slapd[7399]: ch_malloc of 8388608 bytes failed

Setting the cache size to a sane(r) value in /var/lib/ldap/DB_CONFIG remedied it:

# Set the database in memory cache size.
set_cachesize   0       104857600        0