【问题标题】:Android phone reset but leaking memoryAndroid手机重置但内存泄漏
【发布时间】:2011-07-23 16:19:07
【问题描述】:

查看我正在编写的 Android 应用程序的 Dalvik 调试器,我注意到有一组不断重复的通知,每次 Frank 句柄数都在增加。我推测我的应用程序有内存泄漏,当删除我的应用程序没有修复它时,我重置了手机(HTC 纹身,运行 1.6)。但是,将调试器附加到完全干净的手机(即在安装我的应用程序之前)我仍然看到相同的重复通知,并且 Frank 句柄计数继续增加。

任何人都知道发生了什么;这是红鲱鱼吗?

Ta, 欧文

这是日志文件的重复部分(抱歉,我不知道如何合理地格式化 - 请告诉我,我会重新正确格式化):

07-23 16:40:58.209: INFO/LogService(590): 2011-07-23    16:40:58    127.0.0.1    -    127.0.0.1    8182    GET    /info/    -    200    911    0    52    http://null    -    -
07-23 16:40:58.209: INFO/Server(590): Addition of the standard header "pragma" is discouraged as a future versions of the Restlet API will directly support it.
07-23 16:40:58.219: WARN/Server(590): Addition of the standard header "cache-control" is not allowed. Please use the equivalent property in the Restlet API.
07-23 16:40:58.219: WARN/Server(590): Addition of the standard header "expires" is not allowed. Please use the equivalent property in the Restlet API.
07-23 16:40:58.339: INFO/global(590): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.
07-23 16:40:58.339: INFO/global(590): Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.
07-23 16:40:58.349: INFO/LogFilter(590): Couldn't find the mandatory "Host" HTTP header.
07-23 16:40:58.369: DEBUG/Frank Liu(590): enter FDInfo-handle
07-23 16:40:58.369: DEBUG/Frank Liu(590): Frank handle count = 683
07-23 16:40:58.369: DEBUG/Frank Liu(590): after block thread
07-23 16:40:58.369: DEBUG/Frank Liu(590): enter FDInfo-represent
07-23 16:40:58.379: DEBUG/Frank Liu(590): new jsonresp successfully
07-23 16:40:58.379: DEBUG/Frank Liu(590): begin put jsonresp
07-23 16:40:58.389: DEBUG/Frank Liu(590): end put jsonresp
07-23 16:40:58.409: DEBUG/Frank Liu(590): exit FDInfo-represent
07-23 16:40:58.409: DEBUG/Frank Liu(590): exit FDInfo-handle

【问题讨论】:

  • 要格式化代码等,选择它并使用 Ctrl-K

标签: android debugging memory-leaks


【解决方案1】:

我建议的第一件事是找出它是什么应用程序。我假设您正在使用 pid 打印日志(尽管这真的很难,因为您的日志粘贴都被包装了);如果是这样,请使用“ps”找出谁是 pid 590。希望这是一些您可以卸载的第三方应用程序。

【讨论】:

  • 这看起来是 com.fd.httpd。我认为这是一个 HTC Sync 进程,需要运行它才能让我访问设备。这是否意味着我可以忽略这一点而我的错误在其他地方?
  • 可能。您有任何理由认为它会导致您的问题吗?
  • 我得到了看起来像内存泄漏的东西,所以这让我非常怀疑。但是,如果这是导致问题的原因,那么无论我做什么,我的应用程序都会崩溃。这没有发生,所以我认为你是对的,问题出在其他地方。助你一臂之力。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-12-31
  • 1970-01-01
  • 1970-01-01
  • 2012-11-14
相关资源
最近更新 更多