When I coding a Java Application, should I create my own object pooling to avoid object creation. From the Logcat, I see log message saying GC has kicked in a number of times.
Thank you for any suggestion.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In my opinion, I really think it depends on the specifics of your application and the kind of objects you’re using. In the section on Designing for Performance one of the 2 basic rules to follow is
But it again, I think it depends on what you’re trying to do. If you look through the Android source code, you can see many examples of pooling and re-using Objects. For example, in the AbsListView.java it maintains a “recycle bin” of Views to re-use.