私はアプリケーションでMapView + Google Maps APIを使用しています。それは仕事ですが、いつかは記憶に問題があります。私は Android GoogleマップOutOfMemory
のAndroidManifest.xml
に
真
largeHeap =を追加しようとしたが、問題は未解決のまま。
トラックログ:私のフラグメントで
Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 4194316 byte allocation with 1810320 free bytes and 1767KB until OOM at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java) at android.graphics.Bitmap.nativeCreate(Bitmap.java) at android.graphics.Bitmap.createBitmap(Bitmap.java:977) at android.graphics.Bitmap.createBitmap(Bitmap.java:948) at android.graphics.Bitmap.createBitmap(Bitmap.java:915) at com.google.maps.api.android.lib6.gmm6.vector.gl.k.a(:[email protected]:7) at com.google.maps.api.android.lib6.gmm6.vector.gl.ah.a(:[email protected]:73) at com.google.maps.api.android.lib6.gmm6.vector.gl.ah.a(:[email protected]:46) at com.google.maps.api.android.lib6.gmm6.vector.gl.ah.b(:[email protected]:39) at com.google.maps.api.android.lib6.gmm6.vector.gl.drawable.ae.a(:[email protected]:59) at com.google.maps.api.android.lib6.gmm6.vector.gl.drawable.am.a(:[email protected]:346) at com.google.maps.api.android.lib6.gmm6.vector.cb.a(:[email protected]:407) at com.google.maps.api.android.lib6.gmm6.vector.bs.a(:[email protected]:664) at com.google.maps.api.android.lib6.gmm6.vector.bs.b(:[email protected]:270) at com.google.maps.api.android.lib6.gmm6.vector.bb.f(:[email protected]:257) at com.google.maps.api.android.lib6.gmm6.vector.bb.run(:[email protected]:11)
:
@Override public void onResume() { super.onResume(); if (mMapView != null) { mMapView.onResume(); mLocationHelper.checkPlayServices(); } } @Override public void onPause() { super.onPause(); if (mMapView != null) { mMapView.onPause(); } } @Override public void onStop() { super.onStop(); if (mMapView != null) { mMapView.onStop(); } } @Override public void onLowMemory() { super.onLowMemory(); if (mMapView != null && mGoogleMap != null) { mMapView.onLowMemory(); mGoogleMap.clear(); } } @Override public void onDestroyView() { if (mGoogleMap != null) { mGoogleMap.clear(); } if (mMapView != null) { mMapView.onDestroy(); mMapView = null; } super.onDestroyView(); }
図書館:
- プレイサービスマップ:11.4.0
- プレイサービス-場所: 11.4.0
ありがとうございます!
返信いただきありがとうございます...私はMapViewとGoogle Mapsを破壊した時にはっきりさせました。いくつかの解決策を教えてもらえますか? –
いつOOMを特に体験しますか? –