I’ve pushed a number of patches that by default links against tcmalloc. Now works on Linux and MacOS and probably various other Unix-like systems. Both www.swi-prolog.org and swish.swi-prolog.org now run on this version.
If you build the git version you first have to install the Google perftools library that contains tcmalloc. Depending on the OS:
apt install libgoogle-perftools-dev # Debian, Ubuntu, Mint, etc.
dnf install gperftools-devel # Redhat, SuSe, Fedora, CentOS, etc.
port install gperftools # MacOS using Macports
After building, run
?- check_installation.
which should tell you that tcmalloc is working ok.
Further info is here
If you run heavily multi-threaded code that uses a lot of memory you might want to see whether this makes a difference. Please report success or regression.