[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45200: [PATCH] Force Glibc to free the memory freed
From: |
DJ Delorie |
Subject: |
bug#45200: [PATCH] Force Glibc to free the memory freed |
Date: |
Wed, 03 Feb 2021 23:26:45 -0500 |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> [ I have no idea what "fastbins" are, but I'll nod along approvingly. ]
https://sourceware.org/glibc/wiki/MallocInternals
Fastbins are one of the caches layered on the core malloc code.
> OK, so `malloc_trim` can do a more thorough job and discover that
> there's indeed 200MB free at the top which malloc/free wouldn't
> have noticed? I guess that makes sense.
Yes.
> PS: One last thing: I must say I'm surprised to see the amount of
> effort that seems to be spent on trying to release that "top" free
> memory. From where I stand, it seems that it will only very rarely
> allow you to release any non-trivial amount of memory. Why bother?
We have to keep track of the top of heap anyway, in order to grow it.
Adding a check to shrink it is pretty trivial, and it's our *only* way
to return memory to the system.
- bug#45200: [PATCH] Force Glibc to free the memory freed, (continued)
- bug#45200: [PATCH] Force Glibc to free the memory freed, DJ Delorie, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed, Stefan Monnier, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed, DJ Delorie, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed, Stefan Monnier, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed, DJ Delorie, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed, Stefan Monnier, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed, DJ Delorie, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed, Stefan Monnier, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed, DJ Delorie, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed, Stefan Monnier, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed,
DJ Delorie <=
- bug#45200: [PATCH] Force Glibc to free the memory freed, DJ Delorie, 2021/02/03
- bug#45200: [PATCH] Force Glibc to free the memory freed, Stefan Monnier, 2021/02/03