Memory allocation in Android widget
I have developed a widget in Android and it uses too much RAM (over 30 MB). What can it开发者_开发百科 be that takes up so much memory? The widget is a clock and weather widget that uses different skins (saved as drawables).
Thanks
It's hard to say could be a lot of thing. But lucky for you Android DDMS has a Allocation Tracker, that might help you solve your problem.
http://developer.android.com/guide/developing/debugging/ddms.html
You can also using plugin Memory Analyzer tool
Detail you can refer:
https://stackoverflow.com/questions/1147172/what-android-tools-and-methods-work-best-to-find-memory-resource-leaks
https://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android
Another good document guide how to well design layout for widget:
http://developer.android.com/training/improving-layouts/optimizing-layout.html
精彩评论