Android - Ansicht.Oberfläche OutOfResourcesException

Meine Android-app scheint nicht die Freigabe seiner Ansichten, wenn ich mich bewegen Innenseite ist es mit ListView-navigation und mit der standard-Menü-Taste. Nach hundert oder so verschiedene (10 oder so einzigartigen Aussicht) Lasten, beginnt es zu hinken und schwarz-screening.

Fehler melden:

07-01 09:54:42.913: INFO/ActivityManager(1279): Starting: Intent { cmp=com.site.android.conferencecompanion/.Search } from pid 31290
07-01 09:54:43.013: ERROR/msm7x30.gralloc(1279): /dev/pmem: no more pmem available
07-01 09:54:43.013: ERROR/msm7x30.gralloc(1279): couldn't open pmem (No such file or directory)
07-01 09:54:43.013: ERROR/msm7x30.gralloc(1279): gralloc failed err=Out of memory
07-01 09:54:43.013: WARN/GraphicBufferAllocator(1279): alloc(480, 800, 1, 00000133, ...) failed -12 (Out of memory)
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279): Allocated buffers:
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x290740: 1500.00 KiB |  480 ( 480) x  800 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x307448:   60.00 KiB |  102 ( 128) x  120 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x32e4c0:   71.25 KiB |  480 ( 480) x   38 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x3caad8:   60.00 KiB |  102 ( 128) x  120 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x4a47f8: 1346.25 KiB |  480 ( 480) x  718 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x4f9710: 1500.00 KiB |  480 ( 480) x  800 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x54c500: 1500.00 KiB |  480 ( 480) x  800 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x5d1c00: 1500.00 KiB |  480 ( 480) x  800 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x5f5f98: 1500.00 KiB |  480 ( 480) x  800 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x604600:   60.00 KiB |  126 ( 128) x  120 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x60a3d0:  750.00 KiB |  480 ( 480) x  800 |        4 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x661270: 1428.75 KiB |  480 ( 480) x  762 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x6830b8:  750.00 KiB |  480 ( 480) x  800 |        4 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x70e0e8: 1500.00 KiB |  480 ( 480) x  800 |        1 | 0x00000133
07-01 09:54:43.013: DEBUG/GraphicBufferAllocator(1279):   0x71f238:   71.25 KiB |  480 ( 480) 
07-01 09:54:43.013: ERROR/SurfaceFlinger(1279): Layer::requestBuffer(this=0x189d50), index=0, w=480, h=800 failed (Out of memory)
07-01 09:54:43.013: ERROR/Surface(31290): Surface (identity=4545) requestBuffer(0, 0, 0, 0, 00000033) returned a buffer with a null handle
07-01 09:54:43.013: ERROR/Surface(31290): getBufferLocked(0, 0, 0, 0, 00000033) failed (Out of memory)
07-01 09:54:43.013: ERROR/Surface(31290): dequeueBuffer failed (Out of memory)
07-01 09:54:43.013: ERROR/ViewRoot(31290): OutOfResourcesException locking surface
07-01 09:54:43.013: ERROR/ViewRoot(31290): android.view.Surface$OutOfResourcesException
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at android.view.Surface.lockCanvasNative(Native Method)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at android.view.Surface.lockCanvas(Surface.java:314)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at android.view.ViewRoot.draw(ViewRoot.java:1457)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1259)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1860)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at android.os.Looper.loop(Looper.java:123)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at android.app.ActivityThread.main(ActivityThread.java:3839)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at java.lang.reflect.Method.invokeNative(Native Method)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at java.lang.reflect.Method.invoke(Method.java:507)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
07-01 09:54:43.013: ERROR/ViewRoot(31290):     at dalvik.system.NativeStart.main(Native Method)
07-01 09:54:43.203: INFO/ActivityManager(1279): Displayed com.site.android.conferencecompanion/.Search: +292ms

adb shell dumpsys window zeigt Folgendes:

#1 - #29, junk
#30: AppWindowToken{40bbc000 token=HistoryRecord{408cc260 com.site.android.conferencecompanion/.ProgramDates}}

...

#142: AppWindowToken{40ba65a8 token=HistoryRecord{40b93808 com.site.android.conferencecompanion/.ProgramSpeakers}}

So, wenn ich das richtig verstehe, so etwas wie 112 Ansichten werden im Speicher gehalten. Gibt es etwas, was kann ich dagegen tun? Gibt es einen Scheck oder eine Flagge oder ein parameter fehlt mir? Bin ich misinterpretting der dump?

Dank!

  • Haben Sie eine statische Referenz auf einen Kontext oder eine View (die implizit hält einen Zusammenhang)?
  • Ich glaube nicht, dass so, wie kann ich sicher sein?
  • Verwenden Sie einfach das Schlüsselwort static ist ein guter Ort, um zu starten. Hier einige rudimentäre Dokumentation auf Lecks in Android: developer.android.com/resources/articles/...
  • Können Sie bitte klarstellen, was Sie tun im code? Dies geschieht innerhalb einer Aktivität? Oder sind Sie mit der Einführung mehrerer Aktivitäten durch intents aufrufen, wenn der Benutzer wählt ein ListView-Element? Ein code-Beispiel, wie Sie starten/laden einer neuen Sicht gut sein könnte.
InformationsquelleAutor Josh | 2011-07-01
Schreibe einen Kommentar