#2763·jemalloc

internal error: could not change current thread's arena (4.5.0)

Author: hpcponyCreated Nov 17, 2024Updated Jul 24, 2026

I'm using a third-party package that uses jemalloc. On a machine with lots of "cores" (1568=784*2 threads) I'm seeing messages like "<jemalloc>: Reducing narenas to limit (4094)" and "internal error: could not change current thread's arena". In the latter case it dies.

I've been able to trace it down to the ctl.c routine: ctl_byname(tsd_t *tsd, const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen) and the line: ret = node->ctl(tsd, mib, depth, oldp, oldlenp, newp, newlen); which seems to be returning "14". Since ctl is a pointer to a function I can't figure out what's being called trace it any further.

I've adjusted MALLOC_CONF='narenas:512' but it doesn't help. I'm not even sure it's doing anything cause I still see "reducing narenas...".

I'm limited in what I can do and try to fix, but I thought I'd see if this rings a bell with anyone and has an easy fix (like a MALLOC_CONF setting ;^)).

Thanks.