From 9636d9b975ae87262234a6e1cc50b8c23ef82c60 Mon Sep 17 00:00:00 2001 From: dktue <2878623+dktue@users.noreply.github.com> Date: Sat, 7 Nov 2026 22:00:47 +0100 Subject: [PATCH] docs: mention preloading jemalloc for faster large builds On Linux, LD_PRELOAD=libjemalloc.so.2 made the planet 14-17% faster at 96 threads (24:43 / 23:50 -> 20:32, 7 GB less memory) and a Germany extract at 32 threads 4% faster. Documentation only; no new dependency. Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/RUNNING.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/RUNNING.md b/docs/RUNNING.md index ecdf44c5..9ed72777 100644 --- a/docs/RUNNING.md +++ b/docs/RUNNING.md @@ -56,6 +56,17 @@ usage but runs faster. * `--shard-stores`: Group temporary storage by area. Reduces RAM usage on large files (e.g. whole planet) but runs slower. +On Linux, large builds can also run faster with a different memory allocator. tilemaker +allocates and frees a lot of small objects, and with many threads the jemalloc allocator copes +with that better than the default one. Install it (on Debian/Ubuntu: `sudo apt install libjemalloc2`) +and preload it when you run tilemaker: + + LD_PRELOAD=libjemalloc.so.2 tilemaker --input planet.osm.pbf --output planet.pmtiles ... + +(If the library isn't found, give its full path, e.g. `/usr/lib/x86_64-linux-gnu/libjemalloc.so.2`.) +On a 48-core server this made the whole planet 14–17% faster at the default thread count +and needed 7 GB less memory; a Germany extract at 32 threads was 4% faster. + You can also tell tilemaker to only look at .pbf objects with certain tags. If you're making a thematic map, this allows tilemaker to skip data it won't need. Specify this in your Lua file like one of these three examples: