Search This Document
Best practice: Minimizing memory use
To minimize runtime memory, consider the following guidelines:
- Use primitive types (such as int or Boolean) instead of objects (such as String or Integer).
- Do not depend entirely on the garbage collector.
- Avoid creating many objects quickly.
- Set object references to null when you are finished using them.
- Reuse objects as much as possible.
- Move heavy processing to the server. For example, you can filter or sort data before sending it to the BlackBerry® device.