谷歌从Android开放几次后内存不足

时间:2014-10-02 12:41:54

标签: performance android-memory

我有一个包含HTML页面的Android WebView,html文件中的每个元素都有一个链接和图像。链接是google play网站。我不时会收到内存不足的错误,这是我可以得到的logcat:

: Process: com.android.vending, PID: 12924
: java.lang.OutOfMemoryError
:        at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
:        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:677)
:        at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:507)
:        at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:872)
:        at android.content.res.Resources.loadDrawable(Resources.java:3054)
:        at android.content.res.Resources.getDrawable(Resources.java:1613)
:        at android.widget.ImageView.resolveUri(ImageView.java:648)
:        at android.widget.ImageView.setImageResource(ImageView.java:377)
:        at com.google.android.play.image.FifeImageView.setImageResource(FifeImageView.java:536)
:        at com.google.android.play.drawer.PlayDrawerProfileInfoView.configure(PlayDrawerProfileInfoView.java:108)
:        at com.google.android.play.drawer.PlayDrawerAdapter.getProfileContainer(PlayDrawerAdapter.java:267)
:        at com.google.android.play.drawer.PlayDrawerAdapter.getView(PlayDrawerAdapter.java:231)
:        at android.widget.AbsListView.obtainView(AbsListView.java:2733)
:        at android.widget.ListView.makeAndAddView(ListView.java:1811)
:        at android.widget.ListView.fillDown(ListView.java:697)
:        at android.widget.ListView.fillFromTop(ListView.java:763)
:        at android.widget.ListView.layoutChildren(ListView.java:1627)
:        at android.widget.AbsListView.onLayout(AbsListView.java:2546)
:        at android.view.View.layout(View.java:15664)
:        at android.view.ViewGroup.layout(ViewGroup.java:4869)
:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
:        at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
:        at android.view.View.layout(View.java:15664)
:        at android.view.ViewGroup.layout(ViewGroup.java:4869)
:        at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:824)
:        at android.view.View.layout(View.java:15664)
:        at android.view.ViewGroup.layout(ViewGroup.java:4869)
:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
:        at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
:        at android.view.View.layout(View.java:15664)
:        at android.view.ViewGroup.layout(ViewGroup.java:4869)
:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
:        at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
:        at android.view.View.layout(View.java:15664)
:        at android.view.ViewGroup.layout(ViewGroup.java:4869)
:        at com.android.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:429)
:        at android.view.View.layout(View.java:15664)
:        at android.view.ViewGroup.layout(ViewGroup.java:4869)
:        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
:        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
:        at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
:        at android.view.View.layout(View.java:15664)
:        at android.view.ViewGroup.layout(ViewGroup.java:4869)
:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
:        at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
:        at android.view.View.layout(View.java:15664)
:        at android.view.ViewGroup.layout(ViewGroup.java:4869)
:        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2246)
:        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1968)
:        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1200)
:        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6401)
:        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
:        at android.view.Choreographer.doCallbacks(Choreographer.java:603)
:        at android.view.Choreographer.doFrame(Choreographer.java:573)
:        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
:        at android.os.Handler.handleCallback(Handler.java:733)
:        at android.os.Handler.dispatchMessage(Handler.java:95)
:        at android.os.Looper.loop(Looper.java:157)
:        at android.app.ActivityThread.main(ActivityThread.java:5335)
:        at java.lang.reflect.Method.invokeNative(Native Method)
:        at java.lang.reflect.Method.invoke(Method.java:515)
:        at com.android.internal.os.ZygoteInit$Method
):   Force finishing activity com.android.vending/com.google.android.finsky.activities.MainActivity

我不知道还能说些什么来解释这一点。还在挖......

0 个答案:

没有答案