# jemalloc

34 Hacker News commenters recommended jemalloc and 11 criticized it, November 2025 to November 2026. It was recommended in 6 of 13 months; owners who said how long report a median of 8 years (3 owners). It meets the Hacker Approved badge rule.

**Verdict:** Recommended as a drop-in malloc replacement that cuts memory use in long-running programs. Critics say it is a black box and trails newer allocators in multithreaded speed.

## Why people recommend it

- Cuts memory use sharply (7 comments): "With jemalloc's reliable memory return settings, those problems disappear." ([source](https://news.ycombinator.com/item?id=49751758)) "jemalloc consistently used only about half of RAM as opposed to tcmalloc" ([source](https://news.ycombinator.com/item?id=47415980)) "Switched to jemalloc and instantly memory stayed well below 1GB." ([source](https://news.ycombinator.com/item?id=49753142))
- Stable for long-running processes (4 comments): "jemalloc seems to fragment and leak the least for processes running for months" ([source](https://news.ycombinator.com/item?id=47403943)) "jemalloc saved my icinga2 installation that kept exploding in memory usage" ([source](https://news.ycombinator.com/item?id=47409886)) "I've found jemalloc works best for long running libvips processes" ([source](https://news.ycombinator.com/item?id=49136538))
- Strong multithreaded allocation performance (2 comments): "We used jemalloc for a while which helped since it allocates memory better for multithreaded applications" ([source](https://news.ycombinator.com/item?id=47077180)) "It always holds up in benchmarks against any new flavor of the month malloc that comes out." ([source](https://news.ycombinator.com/item?id=47403260))
- Widely used, default on FreeBSD (2 comments): "jemalloc has been the FreeBSD (released) default malloc implementation for the last 18." ([source](https://news.ycombinator.com/item?id=49484872)) "jemalloc is widely used and that’s why it makes sense to be aware of it" ([source](https://news.ycombinator.com/item?id=49751049))

## What people warn about

- Large code size and complexity (2 comments): "something like jemalloc generates 10x as much code as the rest of your app" ([source](https://news.ycombinator.com/item?id=48005928)) "contrast to e.g. the complexity of jemalloc" ([source](https://news.ycombinator.com/item?id=48883295))
- Lacks memory protections (2 comments): "considering it OK to leak memory contents across a process boundary because it's within a cgroup sounds wild" ([source](https://news.ycombinator.com/item?id=47407155)) "Using an allocator without memory protections in 2026" ([source](https://news.ycombinator.com/item?id=47406625))

## Alternatives hackers recommend

- [mimalloc](https://hackerapproved.com/p/mimalloc.md): 22 recommend
- [Bumpalo Rust crate](https://hackerapproved.com/p/bumpalo.md): 8 recommend
- [tcmalloc](https://hackerapproved.com/p/tcmalloc.md): 7 recommend

## Cite as

Hacker Approved, "jemalloc", https://hackerapproved.com/p/jemalloc/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
