I'm making a 2D game for mobile and I noticed that my GC seemed to spike during attack. My normal GC is 40b but during attack it could spike to 2.2kb. I think this is really high specially when I saw a 3D game with only 8b GC. I would love to hear your thoughts about what's a reasonable amount of GC for mobile(e.g device with 512ram). I know I'm supposed to keep the GC as low as possible however I want to have a value I could compare to.
1
-
\$\begingroup\$ As little as possible. Memory fragmentation will eventually become a problem if you do a lot. But don't worry about it unless your profiler tells you there's a problem. \$\endgroup\$ – Almo Mar 27 '18 at 18:49
Add a comment
|
\$\begingroup\$
\$\endgroup\$
There's no real rule on what's reasonable. If your game performs ok, then don't worry about it. If you're having problems and you're sure it's GC, then consider pooling objects. Also check this article: