Yeah when I was doing Android development they have a lint that tells you not to allocate in `onDraw()`. I always thought.. what's the point of a garbage collected language if you then have to carefully avoid allocation?
Uh? You should also avoid memory (de)allocation in 'realtime' part of your code even in languages without GCs!
You should, but it isn't a disaster if you don't, unlike with GC languages.
I'm not so sure, it depends a lot of the memory allocator: if the memory allocator decide to defragment your heap when you call it, you'll get a lot of additional latency..
So that you can mostly avoid having to carefully avoid allocation!