1

My Robotium-based tests run into OutOfMemory problems on API 10 emulators because my activity is not properly released. If I look into MAT (the Memory Analyzer) I see that three instances of my activity are still kept as reference in internal CommitSelectionReceiver's of Android's android.widget.EditText:

MAT output

Now the problem does not seem to persist in 4.x because - according to grepcode at least - such a ResultReceiver is no longer used in the newer platform's code. Still, I want my Robotium tests to be executed on this legacy platform as well.

Has anybody stumbled upon this problem before and knows a temporary fix / workaround to fix this?

Thomas Keller
  • 5,933
  • 6
  • 48
  • 80
  • can you please post some code ... ? – android developer Jun 17 '13 at 14:50
  • Sorry, this is closed source. – Thomas Keller Jun 18 '13 at 06:21
  • so it's very hard to know what could be the problem without knowing anything of what you do. – android developer Jun 18 '13 at 07:30
  • The thing is really that we just enter text in `EditText`s, nothing fancy. The problems only pop up in API 10 emulators, not when the code runs in API 17 emulators. Anyways, thanks for your time. – Thomas Keller Jun 18 '13 at 07:32
  • did you extend from the editText? used a custom library? used images on the edittext ? anything...? – android developer Jun 18 '13 at 07:35
  • I extend from EditText to set a custom typeface, but thats about it. No images on the edit text, nothing else "fancy". – Thomas Keller Jun 18 '13 at 08:27
  • can you please show your code there? have you tried to put your code of the editTexts on a totally new project, just to be sure it's their fault and not something else? – android developer Jun 18 '13 at 10:04
  • No, I was basically hunting for other dev's experience and hoped for an Android bug id where this is described (together with a possible workaround). Unfortunately I don't have the time to research this myself further and I also don't want to bother you anymore with this. In the end it only pops up under testing conditions on an as deprecated marked SDK, so I'd rather stop this here and not waste anyone's time any longer :) – Thomas Keller Jun 18 '13 at 10:38
  • you can do a "divide and conquer" for every thing that you suspect that cause it, on a tiny project that has only the suspect in it. – android developer Jun 18 '13 at 11:51
  • I have the same issue, it has to do with the EditText. Its a known issue a bug on certain devices. Samsung Galaxy S4 is one (Android 4.2.2) this link shows the issue. I have not found a solution. http://stackoverflow.com/questions/14069501/edittext-causing-memory-leak?rq=1 – MobDev Aug 21 '13 at 02:18

0 Answers0