Skip to content

Commit

Permalink
Set Jemalloc --disable-cache-oblivious to reduce memory overhead
Browse files Browse the repository at this point in the history
Apparently for large size classes Jemalloc allocate some extra memory in
order to be CPU cache friendly, but the cost on memory usage is high
(can be up to 25% overhead for allocations of 16kb).
see jemalloc/jemalloc#1098 (comment)

p.s. from redis's perspective that looks like external fragmentation,
(i.e. allocated bytes will be low, and active pages bytes will be large)
which  can cause active-defrag to eat CPU cycles in vain.
  • Loading branch information
oranagra committed Jun 14, 2023
1 parent 1946083 commit 07cc664
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deps/Makefile
Expand Up @@ -106,7 +106,7 @@ endif

jemalloc: .make-prerequisites
@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
cd jemalloc && ./configure --disable-cxx --with-version=5.3.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" $(JEMALLOC_CONFIGURE_OPTS)
cd jemalloc && ./configure --disable-cxx --with-version=5.3.0-0-g0 --with-lg-quantum=3 --disable-cache-oblivious --with-jemalloc-prefix=je_ CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" $(JEMALLOC_CONFIGURE_OPTS)
cd jemalloc && $(MAKE) lib/libjemalloc.a

.PHONY: jemalloc

0 comments on commit 07cc664

Please sign in to comment.