GNU bug report logs - #45200
Wishlist: There should be a `malloc-trim' function

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <hi-angel <at> yandex.ru>

Date: Sat, 12 Dec 2020 18:44:02 UTC

Severity: wishlist

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: DJ Delorie <dj <at> redhat.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: fweimer <at> redhat.com, carlos <at> redhat.com, rudalics <at> gmx.at, hi-angel <at> yandex.ru, eliz <at> gnu.org, 45200 <at> debbugs.gnu.org
Subject: bug#45200: [PATCH] Force Glibc to free the memory freed
Date: Wed, 03 Feb 2021 23:02:05 -0500
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> But wouldn't glibc release that memory even without calling
> `malloc_trim` simply because it's at the top and is larger than
> `M_TRIM_THRESHOLD`?

Probably, if you disabled fastbins.  Like I said earler, I think
fastbins bypasses the top-of-heap consolidation, so the chunks might be
free'd but in the fastbin cache.  malloc_trim() flushes the fastbin
cache.

There are other ways to flush the fastbins but they're harder to
programmatically invoke (i.e. "magic rules").





This bug report was last modified 3 years and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.