Hacker News new | ask | show | jobs
by caoxuwen 4105 days ago
Thanks for the input! I'm a cofounder at Echo. From our experience, one tricky part of Android dev is the garbage collection. For the end users, garbage collection sometimes creates noticeable lag. That's one of the worst experience we want to avoid. So for Echo, it's almost always worth the tradeoff to reuse objects and avoid unnecessary new object creation, which means less garbage collection. But like you said, the middle-age objects could pose some problems in the future. Judging from the past trend, garbage collection will always be one rocky part of the Android land, which was quite a lesson for us when moving from the ios arc world :)
1 comments

This is sound advice.

I've been developing on Android since the 1.x days. Garbage collection has and continues to suck on Android.

People should not be so blind to think that better garbage collection is going to appear soon, and that a real world improved garbage collector will magically make all the GC related performance problems go away.

Google has demonstrated over and over that they are extremely slow to improve things in Android (see Java version support, see audio latency, see NDK, see Eclipse/Gradle transition, etc). And when they do finally improve things, it usually is still lacking.

Garbage collection in general is hard to get right. Even in better environments with highly optimized/tuned GCs, it still causes problems. It is unlikely Android is going to leap frog these.