Skip to content

GC heap does not grow; HXCPP_MINIMUM_WORKING_MEMORY is ignored (allocation ~3x slower than stock) #230

Closed

Description

@dimensionscape

Summary

libhxcpp's GC heap does not grow the way stock hxcpp's does. Under allocation-heavy load it stays at about 5 MB reserved, while stock hxcpp 4.3.53 grows to about 21 MB on the same program. libhxcpp therefore collects roughly four times as often, which makes allocation-heavy code about 3x slower than stock.

HXCPP_MINIMUM_WORKING_MEMORY is also ignored: with it set to 200 MB, libhxcpp still reserves about 5 MB, while stock reserves about 208 MB.

Measurements

From the benchmark suite in bench/ (Windows 11, Ryzen 9 9950X, MSVC 19.44, 64-bit, 3 processes x 10 samples, same sources and compiler flags for both runtimes, matching checksums):

Benchmark libhxcpp vs stock 4.3.53 (throughput)
alloc_small 0.29x
map_int 0.33x
alloc_arrays 0.35x
string_build 0.65x
Setting libhxcpp reserved stock reserved
defaults ~5 MB ~21 MB
HXCPP_MINIMUM_WORKING_MEMORY=200000000 ~5 MB ~208 MB

With a 208 MB heap, stock's speed is unchanged, so collections themselves are cheap there; libhxcpp is paying for collecting far more often.

The sizing defaults and the sizing formula match stock, so the difference is in where the computed size is applied.

Reproduce

cd bench
haxe --run Run --only alloc_small,alloc_arrays,map_int

Severity

High (performance). Affects every allocation-heavy program, and makes the minimum working memory setting a no-op.

Activity

  1. added 2 commits that reference this issue on Oct 20, 2026
    cc7cbdb
    cc69eee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions