- Home /
How bad is 48B GC Allocation?
I'm working on a new asset and have allocation almost down to nothing. The only allocation I've got is 48B from Physics.OverlapSphere().
Is this something I need to worry about...for mobile maybe?
(Ignore PlatformMover.Update() that's only for testing)
Answer by tswalk · Mar 26, 2015 at 09:29 PM
it's nothing unless it's being generated thousand(s) time a frame...
Thanks! I've heard people say it's supposed to be zero, but I can't get there calling this specific function. I only call it twice per frame.
48 bytes per frame can be ignored. The heap size even on older devices starts from few $$anonymous$$B and up. The good practice is to have it zero per frame basis but (like in your case) its inevitable. You should start worrying when you push a few kb each frame and start noticing spikes from Cg.Collect on the graph.
I think you should consider first the scripts that are allocating the most garbage.
Your answer
Follow this Question
Related Questions
Reasonable heap alloc. per second and total ? 0 Answers
Display numbers in UI.Text Garbage Free? 2 Answers
Gc.Collect locations on the Profiler 1 Answer
force and delay Garbage Collection 7 Answers