Best practices
Now that we know what can happen in memory while our application is active, let's examine what we can do to avoid memory leaks and memory churns and optimize our memory management in order to reach our performance target, not just in memory usage, but in garbage collection attendance, because, as we know, it stops any other operation from working.
In the following pages, we will go through a lot of hints and tips using a bottom-up strategy: starting from low-level shrewdness in Java code to highest-level Android practices.
Data types
We weren't joking: we are really talking about Java primitive types, as they are the foundation of all the applications and it's really important to know how to deal with them, even though it may be obvious. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access