Skip to content

Reapply the #581 thread-heap release (TLS detach callback) - #1275

Merged
DeusData merged 1 commit into
mainfrom
fix/restore-thread-heap-release
Jul 26, 2026
Merged

Reapply the #581 thread-heap release (TLS detach callback)#1275
DeusData merged 1 commit into
mainfrom
fix/restore-thread-heap-release

Conversation

@DeusData

Copy link
Copy Markdown
Owner

Reapplies the #581 fix reverted in f843db8 on a false attribution.

The windows-11-arm crashes were an unaligned SQLITE_CONFIG_PAGECACHE slab, fixed in #1274 — removing this callback never changed them, which is what cleared it. The Windows soak then failed simply because the leak was back.

Static MinGW links have no DllMain and register no TLS callback, so mi_thread_done never runs: 607 thread-heaps after 300 requests holding 170 MiB against a ~300 KiB live set. With the callback the 10-minute Windows soak measured 1.1× against the original 53× / 5.9 GB/hr (#581).

This reverts commit f843db8, which removed the #581 fix on a false
attribution. The arm64 shards were crashing because of an unaligned SQLite
page-cache slab (fixed in #1274, arm64 shard 2/2 green since); removing this
callback never changed those crashes, which is what exonerated it. The Windows
soak then failed for the obvious reason: the leak was back.

Static MinGW links have no DllMain and register no TLS callback, so
mi_thread_done never runs and every thread leaks its heap -- 607 heaps after 300
requests holding 170 MiB against a ~300 KiB live set. With the callback the
10-minute Windows soak measured 1.1x against the original 53x.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
@DeusData
DeusData merged commit 4fda0d9 into main Jul 26, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant