cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry client crashes with java.lang.OutOfMemoryError: java.lang.OutOfMemoryError

Former Member
0 Kudos

Hi;

Environment: SMP 3.0 SP5, Android Agentry client SP09 PL01, Android OS: 4.0.4, Device: Samsung Galaxy Ta 2.0

I am working on a custom application that contains an implementation of attachments and the locations tab as per the standard SAP Work Manager 6.2. The client crashes after capturing lots of pictures on the device, not only does it crash but also the speed/perfomance reduces with time as more pictures are captured, navigating through the application becomes slower to be more specific. Eventually the Agentry client crashes with the message "Agentry client is not responding". When I debug the device using DDMS, I get the below error.

My thoughts are that the Agentry client seems to be struggling with garbage collection, it seems to be holding on to memory and as long as there is no sync done or the application hasn't been closed and reopened, the memory piles up, up to a point where it exhausts the memory on the device. Not sure what your guys' take is on this?

07-23 14:33:52.960: D/AndroidRuntime(2372): Shutting down VM

07-23 14:33:52.960: W/dalvikvm(2372): threadid=1: thread exiting with uncaught exception (group=0x40bee1f8)

07-23 14:33:52.960: E/AndroidRuntime(2372): FATAL EXCEPTION: main

07-23 14:33:52.960: E/AndroidRuntime(2372): java.lang.OutOfMemoryError: java.lang.OutOfMemoryError

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:513)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:530)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.helpers.AgentryImageBitmap.getBitmap2(AgentryImageBitmap.java:203)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.helpers.AgentryImageBitmap.getBitmap(AgentryImageBitmap.java:157)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.helpers.AgentryImageBitmap.getBitmap(AgentryImageBitmap.java:122)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.helpers.AgentryImageDrawable.<init>(AgentryImageDrawable.java:139)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.helpers.GriddedAgentryImageDrawable.<init>(GriddedAgentryImageDrawable.java:105)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.helpers.LargeImageHelper.createDrawable(LargeImageHelper.java:494)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.helpers.LargeImageHelper.create(LargeImageHelper.java:436)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.screensets.widgets.EmbeddedImageWidget.createContentView(EmbeddedImageWidget.java:147)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.screensets.widgets.Widget.initialize(Widget.java:338)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.core.mvc.screensets.widgets.WidgetInterop.initialize(WidgetInterop.java:63)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.core.mvc.ModelControllerInterop.onUIInitialized(Native Method)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.core.mvc.ModelControllerInterop.onUIInitialized(ModelControllerInterop.java:67)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.AgentryActivityWithModelController.onPostCreate(AgentryActivityWithModelController.java:521)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1116)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1953)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.ActivityThread.access$600(ActivityThread.java:128)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.os.Handler.dispatchMessage(Handler.java:99)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.os.Looper.loop(Looper.java:137)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.ActivityThread.main(ActivityThread.java:4514)

07-23 14:33:52.960: E/AndroidRuntime(2372): at java.lang.reflect.Method.invokeNative(Native Method)

07-23 14:33:52.960: E/AndroidRuntime(2372): at java.lang.reflect.Method.invoke(Method.java:511)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)

07-23 14:33:52.960: E/AndroidRuntime(2372): at dalvik.system.NativeStart.main(Native Method)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.core.mvc.ModelControllerInterop.onUIInitialized(Native Method)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.core.mvc.ModelControllerInterop.onUIInitialized(ModelControllerInterop.java:67)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.syclo.agentry.client.android.ui.AgentryActivityWithModelController.onPostCreate(AgentryActivityWithModelController.java:521)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1116)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1953)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.ActivityThread.access$600(ActivityThread.java:128)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.os.Handler.dispatchMessage(Handler.java:99)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.os.Looper.loop(Looper.java:137)

07-23 14:33:52.960: E/AndroidRuntime(2372): at android.app.ActivityThread.main(ActivityThread.java:4514)

07-23 14:33:52.960: E/AndroidRuntime(2372): at java.lang.reflect.Method.invokeNative(Native Method)

07-23 14:33:52.960: E/AndroidRuntime(2372): at java.lang.reflect.Method.invoke(Method.java:511)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)

07-23 14:33:52.960: E/AndroidRuntime(2372): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)

07-23 14:33:52.960: E/AndroidRuntime(2372): at dalvik.system.NativeStart.main(Native Method)

07-23 14:33:52.992: W/ActivityManager(215):   Force finishing activity com.coct.inspections62.client.android/com.syclo.agentry.client.android.ui.screensets.WizardScreenSetActivity

07-23 14:33:53.031: E/android.os.Debug(215): !@Dumpstate > dumpstate -k -t -n -z -d -o /data/log/dumpstate_app_error

It looks like there is a memory leak, is there a possible solution to this?

Thanks and Regards;

Sizo

Accepted Solutions (1)

Accepted Solutions (1)

stephen_kringas
Active Participant
0 Kudos

Hi Sizo,

In the release notes of SMP SDK 3.0 SP09 PL05 it has a fix for

"Android client crashing with java.lang.OutOfMemoryError"

Upgrading to the latest client may help with your issue if you haven't already solved it.

Regards,

Stephen

Answers (1)

Answers (1)

mark_pe
Active Contributor
0 Kudos

Sizo,

Hi. Your issue will need to be analyzed closely. With all memory leak statement, the device itself will need to be run in our device debugger. You may need to send that over for analysis.

As far as I know, the team here tried testing our own SAP devices without issue. Yours may be tied to additional reproduction step that we may need to account for.

Like all mobile devices, it may or may not have issues with the OS and the more application you run (ex: YouTube) while the Agentry app is in the background may also contribute to the issue.

Some devices do have hardware issues like: [Q] RAM ISSUES with samsung galaxy tab 2 7.0&amp;hellip; | Samsung Galaxy Tab 2 | XDA Forums

But in SAP we would like to see your device and analyze it. You may need to send this over if you have an incident with us as this will be the next process in supporting your cause.

Please note that SMP 3.0 with Agentry is a much bigger app. It is not like the older Agentry 6.0 or 6.1. We added new features to it. It is like comparing to Windows XP versus Windows 8.  Each time you do the install with newer features the more memory it requires.

So if you have a device that only has 1 Gig of RAM and your operating system takes about 30% of that. Then you are only left with 70%. Now if you add photos into your memory then you may be using more memory as needed. If your customers/users are using other app then they may have an issue with it as well (may try to spread the load between the device and an SD card for pictures).

As stated here we would like to help out. Please send over the device for review (with all the apps installed that shows problem). We will try to replicate it in our Android team of experts.

We will use your data as one case study for SMP 3.0 (Agentry) and Samsung Galaxy Tab.

Have a great day.

Best Regards,

Mark Pe
SAP Platinum Support Engineer