我写了一个应用程序,它可以通过后台服务与服务器通信,以发送请求并获得响应。 如果我执行一些操作(例如发送请求并获得响应)大约20-30次,我的应用程序变得非常慢,我可以通过按任何按钮观察它 - 响应变得非常缓慢。
如果您连续执行相同的操作,经过一段时间后弹出消息显示“应用程序的对应活动未响应”。
我该如何解决这个问题? 这看起来像我的应用程序消耗更多的内存,所以我该如何解决它,或者是否有任何可用Eclipse插件的工具,并将显示应用程序的内存消耗报告,并建议泄漏区域。
I have written an app which can talk to server via background service to send the request and get the response back. If I perform some operation (e.g send request and get response back) around 20-30 times, my application becomes very slow and I can observe it by pressing any button - the response becomes very slow .
If you continuously perform the same operation, after some time a pop up message displays saying "Sorry Activity of the application is not responding".
How can I resolve this issue? It seems like my app consumes more memory, so how can I resolve it OR is there any tool available which can be pluggable with Eclipse and will display the reports of memory consumption of the App, and suggest the leak area.
最满意答案
1.For内存问题 :Eclipse具有强大的内存跟踪工具: 内存分析工具请参考以下参考资料以获取提示使用指南:(参考文献1,2)
2.对于ANR问题 :为了避免ANR对话框,您可以在工作线程或Asyntask中将网络服务的实现部署到后台工具
参考文献:
哪些Android工具和方法最适合查找内存/资源泄漏?
如何在Android中发现我的应用程序的内存使用情况?
1.For Memory issue: Eclipse have powerful tool for memory tracking: Memory Analyzer tool Please refer references below for use guide of tips: (Ref.1, 2)
2.For ANR issue: To avoid ANR dialog you can put implement of network service to background implement in worker thread or Asyntask
References:
What Android tools and methods work best to find memory/resource leaks?
How do I discover memory usage of my application in Android?
更多推荐
发布评论