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.

enter image description here

  • \$\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

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:


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.