I'm struggling with the same problem, but aren't able to fix things like the previous poster. When I switched to reusing views as previously suggested I seem to have delayed the crash, but it still happens. I am drawing a custom bitmap as part of my list items and have tried to keep their generation to a minimum, but the drawing cache still seems to cause the force quit no matter what I do/reuse.
I'll post here if I figure out anything further, but from what I can see just reusing the views doesn't completely fix this problem. Matt On Jan 29, 11:06 am, muckwarrior <[email protected]> wrote: > Never mind, I've managed to solve the problem myself with a hint from > the other similar thread that I didn't see before posting. > > For anyone that encounters the same problem, I fixed it by using > convertView as explained herehttp://androidguys.com/?p=635 > > On Jan 29, 2:23 pm, muckwarrior <[email protected]> wrote: > > > I'm having problems with ListViews in my application. I thought > > everything was fine until I noticed that if I scrolled up and down > > through the list quickly a number of times, sooner or later the app > > would crash with an OutOfMemoryError. > > > When I searched for the error I noticed a number of posts related to > > loading images. As my list items included a small arrow png, I assumed > > the problem lay here. However even after removing this and all other > > drawables I had (gradient background and list separator) the problem > > still remains. > > > Here's the stack trace > > > ERROR/dalvikvm-heap(2362): 66560-byte external allocation too large > > for this process. > > ERROR/(2362):VMwon't let us allocate 66560 bytes > > DEBUG/AndroidRuntime(2362): Shutting downVM > > WARN/dalvikvm(2362): threadid=3: thread exiting with uncaught > > exception (group=0x40013e28) > > ERROR/AndroidRuntime(2362): Uncaught handler: thread main exiting due > > to uncaught exception > > ERROR/AndroidRuntime(2362): java.lang.OutOfMemoryError:bitmapsize > >exceedsVMbudget > > ERROR/AndroidRuntime(2362): at android.graphics.Bitmap.nativeCreate > > (Native Method) > > ERROR/AndroidRuntime(2362): at android.graphics.Bitmap.createBitmap > > (Bitmap.java:343) > > ERROR/AndroidRuntime(2362): at android.view.View.buildDrawingCache > > (View.java:5219) > > ERROR/AndroidRuntime(2362): at android.view.View.getDrawingCache > > (View.java:5112) > > ERROR/AndroidRuntime(2362): at android.view.ViewGroup.drawChild > > (ViewGroup.java:1355) > > ERROR/AndroidRuntime(2362): at android.view.ViewGroup.dispatchDraw > > (ViewGroup.java:1192) > > ERROR/AndroidRuntime(2362): at > > android.widget.AbsListView.dispatchDraw(AbsListView.java:1125) > > ERROR/AndroidRuntime(2362): at android.widget.ListView.dispatchDraw > > (ListView.java:2778) > > ERROR/AndroidRuntime(2362): at android.view.View.draw(View.java: > > 5422) > > ERROR/AndroidRuntime(2362): at android.view.ViewGroup.drawChild > > (ViewGroup.java:1420) > > ERROR/AndroidRuntime(2362): at android.view.ViewGroup.dispatchDraw > > (ViewGroup.java:1192) > > ERROR/AndroidRuntime(2362): at android.view.ViewGroup.drawChild > > (ViewGroup.java:1418) > > ERROR/AndroidRuntime(2362): at android.view.ViewGroup.dispatchDraw > > (ViewGroup.java:1192) > > ERROR/AndroidRuntime(2362): at android.view.View.draw(View.java: > > 5329) > > ERROR/AndroidRuntime(2362): at android.widget.FrameLayout.draw > > (FrameLayout.java:324) > > ERROR/AndroidRuntime(2362): at android.view.ViewGroup.drawChild > > (ViewGroup.java:1420) > > ERROR/AndroidRuntime(2362): at android.view.ViewGroup.dispatchDraw > > (ViewGroup.java:1192) > > ERROR/AndroidRuntime(2362): at android.view.ViewGroup.drawChild > > (ViewGroup.java:1418) > > ERROR/AndroidRuntime(2362): at android.view.ViewGroup.dispatchDraw > > (ViewGroup.java:1192) > > ERROR/AndroidRuntime(2362): at android.view.View.draw(View.java: > > 5329) > > ERROR/AndroidRuntime(2362): at android.widget.FrameLayout.draw > > (FrameLayout.java:324) > > ERROR/AndroidRuntime(2362): at > > com.android.internal.policy.impl.PhoneWindow$DecorView.draw > > (PhoneWindow.java:1701) > > ERROR/AndroidRuntime(2362): at android.view.ViewRoot.draw > > (ViewRoot.java:980) > > ERROR/AndroidRuntime(2362): at > > android.view.ViewRoot.performTraversals(ViewRoot.java:829) > > ERROR/AndroidRuntime(2362): at android.view.ViewRoot.handleMessage > > (ViewRoot.java:1103) > > ERROR/AndroidRuntime(2362): at android.os.Handler.dispatchMessage > > (Handler.java:88) > > ERROR/AndroidRuntime(2362): at android.os.Looper.loop(Looper.java: > > 123) > > ERROR/AndroidRuntime(2362): at android.app.ActivityThread.main > > (ActivityThread.java:3742) > > ERROR/AndroidRuntime(2362): at > > java.lang.reflect.Method.invokeNative(Native Method) > > ERROR/AndroidRuntime(2362): at java.lang.reflect.Method.invoke > > (Method.java:515) > > ERROR/AndroidRuntime(2362): at com.android.internal.os.ZygoteInit > > $MethodAndArgsCaller.run(ZygoteInit.java:739) > > ERROR/AndroidRuntime(2362): at > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497) > > ERROR/AndroidRuntime(2362): at dalvik.system.NativeStart.main > > (Native Method) > > > I've had a look in DDMS and noticed that the percentage memory used in > > the heap doesn't go above 70%. Also, doesn't the reported 66K seem > > like a very small amount to be causing a crash? > > > Any help appreciated! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

