开发者

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:

  1. https://stackoverflow.com/questions/1147172/what-android-tools-and-methods-work-best-to-find-memory-resource-leaks

  2. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜