English 中文(简体)
a. 在美术馆内打字
原标题:Android memory leak with ListView inside a Gallery

我早就在我的安永应用中追踪潜在的记忆泄露,我早就看到我不敢肯定会做些什么。 首先,我描述了我试图做些什么。

For what it s worth, I m building for Eclair (2.1, API level 7) and testing on an HTC Incredible running Gingerbread (2.3.7, API level 10). From observing LogCat, I assume my application has a maximum heap size of about 32MB.

我正试图建立一个有几页接触的地址书。 您通过滚动左和右边在网页上航行,并通过滚动和缩小在网页上航行。 为此,我使用一个<代码>Gallery,使适应者将接触清单改编为<代码>ListView,而适应者则将单一接触改编为

一切似乎都在打工,但是,当通过彩票wi食时,我会很快摆脱本土(外部)记忆。 我在冲上了<条码>Gallery后,做了一次HPROF的堆放,将其拖到MAT。 在《希图》中,我发现我有几百个接触密码。 RelativeLayouts which were held onto only by my communication ListViews. 这里,我想到的是我所看到的“被冻结的”MAT。 http://www.ohchr.org。

android.view.ViewRoot$1
+ this$0 android.view.ViewRoot
  + mAttachInfo android.view.View$AttachInfo
    + mScrollContainers java.util.ArrayList
      + array java.lang.Object[303]
        + [110], [112], [114], [116], [118], ... com.example.LeakyListView
        + ...and so forth.

唯一被漏掉的物品<代码> ListViews was this android.view.View$AttachInfo smScrollContainers field. 问题在于,我不知道我的看法是怎样首先出现在那里,因此,我错失了如何堵塞这种泄漏。

www.un.org/Depts/DGACM/index_spanish.htm 我如何解决这一记忆泄露问题? 或者至少,这一参考链是如何建造的,什么是<代码>。 ViewRoot,AttachInfo, and mScrollContainers?

我很快尝试并把它孤立于一个简单的测试案例和员额代码上,但我希望这足以使对话开始。

最佳回答

确实,你应当使用“观点”而不是“美术”:

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...