Android - OutOfMemoryError when running tests on a MapActivity

399 views
Skip to first unread message

gianpi

unread,
Nov 3, 2011, 1:03:58 PM11/3/11
to Jenkins Users
Hello,

we're currently trying to set up Jenkins to automate the build and
test of one of our Android projects.
The setup seems to work fine, using the android emulator plugin and
ant, but the build keeps failing with an OutOfMemoryError when running
a test case on a MapActivity.
Normally we'd consider it a normal memory problem (and we're still
also investigating that direction), however the same test case runs
perfectly fine on both emulators and devices, they only fail on
Jenkins.

One thing we already tried is to set vm.heapSize=512M, but with no
success.

Can anyone help with this?

Here is the stack trace, please let me know if I can support with more
information:


11-01 12:05:16.254 D/[LOG_TAG] : ( 534):
StoreLocatorUtils.java(217)::resetAllFilters(): Resetting all
StoreLocator filters
11-01 12:05:16.254 D/[LOG_TAG] : ( 534):
HttpWrapper.java(122)::shutdownConnections(): Shutting down HTTP
connections
11-01 12:05:16.743 I/ActivityManager( 78): Starting: Intent
{ act=android.intent.action.MAIN flg=0x10000000
cmp=com.package/.features.storelocator.StoreLocatorActivity } from pid
534
11-01 12:05:17.304 D/dalvikvm( 78): GC_CONCURRENT freed 1166K, 52%
free 5053K/10375K, external 3125K/3903K, paused 9ms+28ms
11-01 12:05:17.823 D/[LOG_TAG] : ( 534):
PackageMapActivity.java(72)::onCreate(): Binding to life cylce service
11-01 12:05:18.583 D/dalvikvm( 534): GC_EXTERNAL_ALLOC freed 959K,
44% free 4407K/7815K, external 15730K/15854K, paused 131ms
11-01 12:05:18.773 D/dalvikvm( 534): GC_EXTERNAL_ALLOC freed 0K, 44%
free 4407K/7815K, external 15730K/15854K, paused 120ms
11-01 12:05:18.873 I/dalvikvm-heap( 534): Clamp target GC heap from
24.368MB to 24.000MB
11-01 12:05:18.893 D/dalvikvm( 534): GC_FOR_MALLOC freed 3K, 44% free
4403K/7815K, external 16077K/18125K, paused 77ms
11-01 12:05:19.104 D/dalvikvm( 534): GC_EXTERNAL_ALLOC freed 7K, 44%
free 4402K/7815K, external 16077K/18125K, paused 128ms
11-01 12:05:19.264 I/dalvikvm-heap( 534): Clamp target GC heap from
24.367MB to 24.000MB
11-01 12:05:19.264 D/dalvikvm( 534): GC_FOR_MALLOC freed 0K, 44% free
4402K/7815K, external 16077K/18125K, paused 76ms
11-01 12:05:20.194 I/dalvikvm-heap( 534): Clamp target GC heap from
24.957MB to 24.000MB
11-01 12:05:20.194 D/dalvikvm( 534): GC_CONCURRENT freed 1083K, 42%
free 5006K/8519K, external 16077K/18125K, paused 10ms+12ms
11-01 12:05:20.384 D/dalvikvm( 534): GC_EXTERNAL_ALLOC freed 645K,
48% free 4431K/8519K, external 16077K/18125K, paused 120ms
11-01 12:05:20.454 E/dalvikvm-heap( 534): 2116-byte external
allocation too large for this process.
11-01 12:05:20.544 I/dalvikvm-heap( 534): Clamp target GC heap from
24.394MB to 24.000MB
11-01 12:05:20.544 E/GraphicsJNI( 534): VM won't let us allocate 2116
bytes
11-01 12:05:20.544 D/dalvikvm( 534): GC_FOR_MALLOC freed <1K, 48%
free 4430K/8519K, external 16077K/18125K, paused 79ms
11-01 12:05:20.544 D/skia ( 534): --- decoder->decode returned
false
11-01 12:05:20.554 D/AndroidRuntime( 534): Shutting down VM
11-01 12:05:20.554 W/dalvikvm( 534): threadid=1: thread exiting with
uncaught exception (group=0x40015560)
11-01 12:05:20.593 E/AndroidRuntime( 534): FATAL EXCEPTION: main
11-01 12:05:20.593 E/AndroidRuntime( 534):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.package/
com.package.features.storelocator.StoreLocatorActivity}:
android.view.InflateException: Binary XML file line #8: Error
inflating class com.package.features.storelocator.map.StoreLocatorMap
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1647)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1663)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.os.Looper.loop(Looper.java:130)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.app.ActivityThread.main(ActivityThread.java:3683)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
java.lang.reflect.Method.invokeNative(Native Method)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
java.lang.reflect.Method.invoke(Method.java:507)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
dalvik.system.NativeStart.main(Native Method)
11-01 12:05:20.593 E/AndroidRuntime( 534): Caused by:
android.view.InflateException: Binary XML file line #8: Error
inflating class com.package.features.storelocator.map.StoreLocatorMap
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.createView(LayoutInflater.java:518)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.inflate(LayoutInflater.java:408)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.inflate(LayoutInflater.java:320)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.inflate(LayoutInflater.java:276)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:
207)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.app.Activity.setContentView(Activity.java:1657)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
com.package.features.storelocator.StoreLocatorActivity.onCreate(StoreLocatorActivity.java:
192)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1611)
11-01 12:05:20.593 E/AndroidRuntime( 534): ... 11 more
11-01 12:05:20.593 E/AndroidRuntime( 534): Caused by:
java.lang.reflect.InvocationTargetException
11-01 12:05:20.593 E/AndroidRuntime( 534): at
java.lang.reflect.Constructor.constructNative(Native Method)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
java.lang.reflect.Constructor.newInstance(Constructor.java:415)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.view.LayoutInflater.createView(LayoutInflater.java:505)
11-01 12:05:20.593 E/AndroidRuntime( 534): ... 25 more
11-01 12:05:20.593 E/AndroidRuntime( 534): Caused by:
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:
336)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:
697)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.content.res.Resources.loadDrawable(Resources.java:1709)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
android.content.res.Resources.getDrawable(Resources.java:581)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
com.google.android.maps.MapView.setup(MapView.java:319)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
com.google.android.maps.MapActivity.setupMapView(MapActivity.java:404)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
com.google.android.maps.MapView.<init>(MapView.java:289)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
com.google.android.maps.MapView.<init>(MapView.java:264)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
com.google.android.maps.MapView.<init>(MapView.java:247)
11-01 12:05:20.593 E/AndroidRuntime( 534): at
com.package.features.storelocator.map.StoreLocatorMap.<init>(StoreLocatorMap.java:
75)
11-01 12:05:20.593 E/AndroidRuntime( 534): ... 28 more
11-01 12:05:20.623 W/ActivityManager( 78): Error in app com.package
running instrumentation ComponentInfo{com.package.test/
com.package.test.InstrumentationTestRunner}:
11-01 12:05:20.623 W/ActivityManager( 78):
java.lang.OutOfMemoryError
11-01 12:05:20.633 W/ActivityManager( 78):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-01 12:05:20.643 D/AndroidRuntime( 526): Shutting down VM
11-01 12:05:20.664 I/ActivityManager( 78): Force stopping package
com.package uid=10038
11-01 12:05:20.703 I/Process ( 78): Sending signal. PID: 534 SIG: 9
11-01 12:05:20.763 I/AndroidRuntime( 526): NOTE: attach of thread
'Binder Thread #3' failed
11-01 12:05:20.763 D/dalvikvm( 526): GC_CONCURRENT freed 294K, 71%
free 297K/1024K, external 0K/0K, paused 2ms+2ms
11-01 12:05:20.773 D/jdwp ( 526): adbd disconnected

Thanks,
g

Elkin, Michael

unread,
Nov 3, 2011, 3:40:27 PM11/3/11
to jenkins...@googlegroups.com
Have you tried copying a working AVD to the Jenkins agent to replicate whether it might be an AVD configuration issue?

Hello,

Thanks,
g

IMPORTANT NOTICE: This e-mail message is intended to be received only by persons entitled to receive the confidential information it may contain. E-mail messages sent from this company may contain information that is confidential and may be legally privileged. Please do not read, copy, forward or store this message unless you are an intended recipient of it. If you received this transmission in error, please notify the sender by reply e-mail and delete the message and any attachments.

gianpi

unread,
Nov 7, 2011, 3:59:58 AM11/7/11
to Jenkins Users
On Nov 3, 8:40 pm, "Elkin, Michael"
<michael.el...@bridgepointeducation.com> wrote:

> Have you tried copying a working AVD to the Jenkins agent to replicate whether it might be an AVD configuration issue?>
Hi Michael,

thanks for the tip but it didn't solve the problem.
However we found out that this only happens when we set up a 2.3
emulator. As long as we keep it on 2.2 (API level 8) that doesn't
happen anymore and everything works just fine.
Maybe the 2.3 emulator requires too much memory for the machine we
have, not sure :)

Thanks,
g

Christopher Orr

unread,
Nov 9, 2011, 4:18:51 AM11/9/11
to jenkins...@googlegroups.com

Do you have the "Show emulator window" option disabled? I've seen
similar errors occurring when the emulator window was *not* shown.

For that reason, we run all our tests with the window showing, in an
Xvnc instance.

Regards,
Chris

Elkin, Michael

unread,
Nov 9, 2011, 3:17:54 PM11/9/11
to jenkins...@googlegroups.com
Also to point out - are you using android-9 or android-10? Android-9 seems to be a limited set of devices, and I've seen some very weird emulator behavior with that specific API level. Skipping android-9 (2.3.1) and going to android-10 (2.3.3) resolved a number of problems with some of our emulator tests.

Regards,
Chris

IMPORTANT NOTICE: This e-mail message is intended to be received only by persons entitled to receive the confidential information it may contain. E-mail messages sent from this company may contain information that is confidential and may be legally privileged. Please do not read, copy, forward or store this message unless you are an intended recipient of it. If you received this transmission in error, please notify the sender by reply e-mail and delete the message and any attachments.

Reply all
Reply to author
Forward
0 new messages