4

I ran MAT on my application to see if I can reduce memory leaks and `OutOfMemoryException's that are happening to my users.

I saw in the histogram that was generated by the tool that one of my activities wasn't cleared from memory even though I called finish and created no cyclic references that I was aware of. so I looked through all the incoming references excluding all soft/weak references and saw that there's an EditText that has no name and that I haven't put in the activity.

attached is a screenshot of the report.

please help me understand how to plug this leak.

MAT screenshot

thepoosh
  • 12,497
  • 15
  • 73
  • 132
  • 1
    That looks like the object is about to be finalized and garbage collected. Did you force a GC before recording the memory dump? – zapl Jan 21 '14 at 18:15
  • What are you running this on? Device or emulator? OS level? The current source for `android.widget.Editor` does not show any references to `OrientationEventListener`. – CommonsWare Jan 21 '14 at 18:17
  • @zapl - I always force GC before getting a dump. – thepoosh Jan 21 '14 at 18:21
  • @CommonsWare - multiple devices, multiple OS, in this case it was a SGH-T999 running the T-Mobile version of Android 4.1.2 – thepoosh Jan 21 '14 at 18:22
  • 1
    [Memory leak through IClipboardDataPasteEventImpl](http://stackoverflow.com/questions/14135931/memory-leak-through-iclipboarddatapasteeventimpl) seems relevant (and hints to a Samsung bug). The `FinalizerReference` is btw no sign of impending collection as I thought, it is created for objects that override [`finalize` upon creation](http://stackoverflow.com/a/4759026/995891) – zapl Jan 21 '14 at 19:24
  • Umm can you tell me the OS build ID? – Reno Jan 21 '14 at 19:56
  • @Reno - http://pbrd.co/1hfa3sh – thepoosh Jan 21 '14 at 20:07

0 Answers0