[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Improve heap shrinkage calculation
From: |
Peter Bex |
Subject: |
[PATCH] Improve heap shrinkage calculation |
Date: |
Sun, 1 Dec 2019 15:43:17 +0100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
Hi all,
As suggested by Sven Hartrumpf in #1379, the current logic which
decides when the heap should be shrunk is confusing and looks
"obviously wrong".
For one, the "count" variable indicates the actual used memory.
This is in one half of the heap, so it seems incorrect to me to
calculate the watermark on the full heap size (which is what the
current code does). And taking a percentage of a percentage seems
wrong as well.
The attached patch fixes the code as suggested by Sven and adds
a parameter to allow the user to tweak the low watermark as well.
Cheers,
Peter
0001-Improve-heap-shrinkage-factor.patch
Description: Text Data
signature.asc
Description: PGP signature
- [PATCH] Improve heap shrinkage calculation,
Peter Bex <=