From: Dietmar Maurer <dietmar@proxmox.com>
To: Kefu Chai <k.chai@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [RFC] Re-enable alternative memory allocator (tcmalloc) for pve-qemu?
Date: Thu, 26 Mar 2026 07:16:29 +0100 [thread overview]
Message-ID: <03fc2a07-34c8-4029-bbed-f1c764d4562e@proxmox.com> (raw)
In-Reply-To: <DHCDIFA0P8QP.2CTY4G4EEGKQ0@proxmox.com>
> The mechanism is well-understood: librbd creates many small temporary
> objects per I/O operation, and glibc's allocator is slow under that
> fragmentation pattern.
Such things are usually easy to fix using by using a custom pool
allocator, freeing
all allocated objects at once. But I don't know the Ceph code, so I am
not sure if it is
possible to apply such pattern to the Ceph code ...
> But both allocators provide explicit "release everything now" APIs:
>
> - gperftools: MallocExtension::instance()->ReleaseFreeMemory()
> (calls ReleaseToSystem(LONG_MAX) internally)
> - jemalloc: mallctl("arena.<i>.purge", ...)
The problem with that is that it can halt/delay the whole application
while freeing memory?
We need to make sure that there is no noticeable delay.
> ## Questions for the team
>
> 1. Does anyone remember why tcmalloc was removed after only 8 days
> in 2015 (2.3-4)? The changelog just says "remove tcmalloc" with
> no explanation.
Not really, sorry.
> 2. Fiona: given the backup memory reclamation work in 5f9cb29, would
> you see a problem with replacing malloc_trim with the
> allocator-specific release API in the backup completion path?
>
> 3. Has the proxmox-backup-qemu library's allocation pattern changed
> since 2020 in ways that might affect this? (e.g., different buffer
> management, Rust allocator changes)
I am not aware of such changes.
next prev parent reply other threads:[~2026-03-26 6:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 2:54 Kefu Chai
2026-03-26 6:09 ` DERUMIER, Alexandre
2026-03-26 6:16 ` Dietmar Maurer [this message]
2026-03-26 7:48 ` Kefu Chai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=03fc2a07-34c8-4029-bbed-f1c764d4562e@proxmox.com \
--to=dietmar@proxmox.com \
--cc=k.chai@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.