chicken-hackers
[Top][All Lists]
Advanced

[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

Attachment: 0001-Improve-heap-shrinkage-factor.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]