diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2023-05-04 12:14:59 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-05-11 11:56:36 -0400 |
commit | 05cea68c0f883999e8fc69edd305906041f44829 (patch) | |
tree | 574ed9af99f1c270ca0647423c15442269bde37c /compiler/GHC/StgToJS/DataCon.hs | |
parent | ad16a0666340723b656879f4c0bb94653363608b (diff) | |
download | haskell-05cea68c0f883999e8fc69edd305906041f44829.tar.gz |
rts: Refine memory retention behaviour to account for pinned/compacted objects
When using the copying collector there is still a lot of data which
isn't copied (such as pinned, compacted, large objects etc). The logic
to decide how much memory to retain didn't take into account that these
wouldn't be copied. Therefore we pessimistically retained 2* the amount
of memory for these blocks even though they wouldn't be copied by the
collector.
The solution is to split up the heap into two parts, the parts which
will be copied and the parts which won't be copied. Then the appropiate
factor is applied to each part individually (2 * for copying and 1.2 *
for not copying).
The T23221 test demonstrates this improvement with a program which first
allocates many unpinned ByteArray# followed by many pinned ByteArray#
and observes the difference in the ultimate memory baseline between the
two.
There are some charts on #23221.
Fixes #23221
Diffstat (limited to 'compiler/GHC/StgToJS/DataCon.hs')
0 files changed, 0 insertions, 0 deletions