Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid basic API v2 MapActivity outOfMemory with 10 markers
    text
    copied!<p>I am trying to implement map using Android Maps API v2 with Android Support Library, testing on Droid2 with Android 2.2 Everything is working well but just for a short period of time. Once I add 10 markers and try to move the map around or zoom in/out the following errors are thrown every second resulting in dreaded exception and crash follows. I am doing nothing in the background. There is literally just the map and 10 markers.</p> <p>Thank you for any tips.</p> <p>Martin</p> <p><strong>Errors:</strong></p> <pre><code>01-07 03:03:23.221: DEBUG/dalvikvm(12914): GC_FOR_MALLOC freed 38714 objects / 1797752 bytes in 74ms 01-07 03:03:23.378: ERROR/dalvikvm-heap(12914): 1048576-byte external allocation too large for this process. 01-07 03:03:23.378: ERROR/GraphicsJNI(12914): VM won't let us allocate 1048576 bytes 01-07 03:03:23.378: WARN/System.err(12914): OutOfMemory 01-07 03:03:23.432: DEBUG/dalvikvm(12914): GC_EXPLICIT freed 8793 objects / 601896 bytes in 58ms 01-07 03:03:23.862: ERROR/dalvikvm-heap(12914): 1048576-byte external allocation too large for this process. 01-07 03:03:23.862: ERROR/GraphicsJNI(12914): VM won't let us allocate 1048576 bytes 01-07 03:03:23.870: WARN/System.err(12914): OutOfMemory </code></pre> <p><strong>Exception:</strong></p> <pre><code>01-07 02:45:12.432: ERROR/dalvikvm-heap(12315): 1048576-byte external allocation too large for this process. 01-07 02:45:12.432: ERROR/GraphicsJNI(12315): VM won't let us allocate 1048576 bytes 01-07 02:45:12.464: WARN/dalvikvm(12315): threadid=17: thread exiting with uncaught exception (group=0x400208b0) 01-07 02:45:12.479: ERROR/AndroidRuntime(12315): FATAL EXCEPTION: GLThread 18 java.lang.OutOfMemoryError: bitmap size exceeds VM budget at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:498) at maps.r.h.a(Unknown Source) at maps.cp.a.a(Unknown Source) at maps.cp.a.a(Unknown Source) at maps.cp.a.b(Unknown Source) at maps.m.n.a(Unknown Source) at maps.m.at.a(Unknown Source) at maps.a.bq.a(Unknown Source) at maps.a.w.a(Unknown Source) at maps.a.w.a(Unknown Source) at maps.a.w.a(Unknown Source) at maps.a.ba.m(Unknown Source) at maps.a.ba.run(Unknown Source) </code></pre> <p><strong>Layout:</strong> </p> <pre><code>&lt;fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:map="http://schemas.android.com/apk/res-auto" class="com.google.android.gms.maps.SupportMapFragment" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" map:cameraTargetLat="49.85" map:cameraTargetLng="15.42" map:mapType="normal" map:uiCompass="true" map:uiRotateGestures="true" map:uiScrollGestures="true" map:uiTiltGestures="true" map:uiZoomControls="false" map:uiZoomGestures="true" /&gt; </code></pre> <p><strong>Markers:</strong></p> <pre><code> for (int i = 0; i &lt; 9; i++) { mMap.addMarker(new MarkerOptions() .position(new LatLng(49d, 16d)) .draggable(true) .title("BUUUUU") .snippet("TEST")); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload