Skip to main content
Participant
May 20, 2015
Question

Adobe Air 17 - Android Crash

  • May 20, 2015
  • 1 reply
  • 444 views

Hi,

I have a digital signage app that runs unattended on Android devices (Rockchip RK3066 / RK3188). Users can create their own designs online (like 'wix' I guess), then the device downloads the XML playlist and runs it all as a playlist on the device.

So the problem is this: I have a 2 videos on the timeline (H.264 MP4) and they basically play one after the other. The videos have no sound. Because the device is lower powered it seems I have to recreate / reinitialize the video each time before I play it (rather than just pause and hide it whilst the other plays). Everything seems to run fine then after a while (hours) the app will just freeze up. The latest test ran for around 11 hours before it locked up, however I have seen it lock up after just 2 hours previously.

To try and pin the issue down I have run Adobe Scout and also have collected the logcat and 'ANR' log here for you to look at.

The app is called "com.posstream.MediaPlayer"

LogCat: It seems like it starts with a stack trace around line 6225  https://dl.dropboxusercontent.com/u/48240680/AdobeAirCrash/logcat_20-May-2015.txt

ANR trace: https://dl.dropboxusercontent.com/u/48240680/AdobeAirCrash/traces.txt

Tombstone: https://dl.dropboxusercontent.com/u/48240680/AdobeAirCrash/tombstone_05

Here are the source videos:

Fire: https://dl.dropboxusercontent.com/u/48240680/AdobeAirCrash/Fire.mp4

Water: https://dl.dropboxusercontent.com/u/48240680/AdobeAirCrash/Water.mp4

ActionScript: I call "play" and "stop".

public function play:void

  {

  _connection = new NetConnection();

  _connection.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

  _connection.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

  _connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler, false, 0, true);

  _connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler, false, 0, true);

  _connection.connect(null);

  _stream = new NetStream(_connection);

  _stream.client = this;

  _stream.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

  _stream.removeEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);

  _stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler, false, 0, true);

  _stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler, false, 0, true);

  _video.attachNetStream(_stream);

  _stream.play(_url);

  }

public function stop():void

  {

  _stream.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

  _stream.removeEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);

  _stream.pause();

  _video.attachNetStream(null);

  _stream.close();

  _connection.removeEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

  _connection.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

  _connection.close()

  }

I don't understand why it works for so long then just randomly dies. Anyone have any ideas? Adobe AIR team can you assist please?

Thanks

This topic has been closed for replies.

1 reply

Mayamoto
Participant
June 10, 2015

Everything points to a memory leak. Here are few suggestions:

  • monitor the memory via tracing System.privateMemory in a timer function, for indication of faults and improvements.
  • set _stream and _connection to null after you are done with them.
  • force garbage collection System.gc()  every once and a while to clear any lingering garbage (not best practice, but hey, it is sometimes helpful until they fix the leak).

Hope some of these help.

Cheers

Participant
June 12, 2015

Hi Mayamoto,

Thanks for your suggestions.

There never seems to be any spike in memory (I ran it for 7+ hours with Scout) ... everything seemingly behaves itself.

From searching the LogCat errors... it turns out that it's a bug in Android JellyBean itself. Apparently a video looping itself for many hours just hangs the system after a while. Hopefully the bug is fixed on KitKat... I will try it and report back on this thread with the findings.

If I get a chance to setup a test rig again I will try your setting of _stream and _connection to null and force GC and see if it makes any difference.

Appreciate your reply!