横向きから縦向きに、またはその逆に移動し続けると、アプリケーションが予告なしに突然閉じます。また、あるアクティビティから別のアクティビティに値を送信し続けると、同じエラーが発生します。LogCat から取得したエラーは次のとおりです。
動き続けるからのログ 横向きと縦向き
04-22 20:23:31.110: E/dalvikvm-heap(6275): 5891496-byte external allocation too large for this process.
04-22 20:23:31.120: E/dalvikvm(6275): Out of memory: Heap Size=5639KB, Allocated=3205KB, Bitmap Size=22062KB, Limit=32768KB
04-22 20:23:31.120: E/dalvikvm(6275): Trim info: Footprint=5639KB, Allowed Footprint=5639KB, Trimmed=496KB
04-22 20:23:31.120: E/GraphicsJNI(6275): VM won't let us allocate 5891496 bytes
あるアクティビティから別のアクティビティに値を送信し続けることからのログ
04-22 21:57:04.497: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 19K, 47% free 2901K/5379K, external 1151K/1663K, paused 24ms
04-22 21:57:04.647: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 85K, 45% free 2960K/5379K, external 2320K/2875K, paused 24ms
04-22 21:57:04.807: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 2K, 45% free 2960K/5379K, external 8073K/10082K, paused 23ms
04-22 21:57:04.927: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4053a410
04-22 21:57:04.937: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@405316d0
04-22 21:57:04.937: D/WindowManagerImpl(9570): addView, new view, mViews[1]: com.android.internal.policy.impl.PhoneWindow$DecorView@40515820
04-22 21:57:05.227: D/WindowManagerImpl(9570): finishRemoveViewLocked, mViews[0]: com.android.internal.policy.impl.PhoneWindow$DecorView@40522768
04-22 21:57:06.158: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:06.158: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:06.238: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4054e1f0
04-22 21:57:06.529: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:06.529: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:06.549: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40559870
04-22 21:57:07.019: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 83K, 45% free 3035K/5447K, external 13863K/15875K, paused 25ms
04-22 21:57:07.129: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:07.129: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:07.149: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40552178
04-22 21:57:07.289: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:07.289: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:07.369: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 34K, 44% free 3058K/5447K, external 12711K/14759K, paused 26ms
04-22 21:57:07.600: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40534f78
04-22 21:57:08.050: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:08.050: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:08.050: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4053da60
04-22 21:57:08.421: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:08.421: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:08.431: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4055caf0
04-22 21:57:08.771: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:08.771: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:08.841: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 55K, 44% free 3092K/5447K, external 18465K/18465K, paused 24ms
04-22 21:57:09.091: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40530708
04-22 21:57:09.201: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 9K, 44% free 3093K/5447K, external 24218K/24218K, paused 24ms
04-22 21:57:09.321: D/dalvikvm(9570): GC_FOR_MALLOC freed <1K, 44% free 3092K/5447K, external 24218K/24218K, paused 17ms
04-22 21:57:09.341: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:09.341: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:09.351: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4055df78
04-22 21:57:09.542: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:09.542: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:09.542: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@40566488
04-22 21:57:09.692: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 70K, 44% free 3098K/5511K, external 24218K/24218K, paused 30ms
04-22 21:57:09.812: D/dalvikvm(9570): GC_FOR_MALLOC freed 5K, 44% free 3093K/5511K, external 24218K/24218K, paused 17ms
04-22 21:57:09.872: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:09.872: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:09.882: D/ATRecorder(9570): com.htc.autotest.dlib.RecordEngine in loader dalvik.system.DexClassLoader@4054bd48
04-22 21:57:10.312: D/View(9570): onTouchEvent: viewFlags: 0x18004081
04-22 21:57:10.312: D/View(9570): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
04-22 21:57:10.412: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed 51K, 44% free 3099K/5511K, external 24218K/24218K, paused 24ms
04-22 21:57:10.533: D/dalvikvm(9570): GC_FOR_MALLOC freed 3K, 44% free 3096K/5511K, external 24218K/24218K, paused 17ms
04-22 21:57:10.613: D/dalvikvm(9570): GC_EXTERNAL_ALLOC freed <1K, 44% free 3097K/5511K, external 24218K/24218K, paused 28ms
04-22 21:57:10.613: E/dalvikvm-heap(9570): 5891496-byte external allocation too large for this process.
04-22 21:57:10.613: E/dalvikvm(9570): Out of memory: Heap Size=5511KB, Allocated=3097KB, Bitmap Size=24218KB, Limit=32768KB
04-22 21:57:10.613: E/dalvikvm(9570): Trim info: Footprint=5511KB, Allowed Footprint=5511KB, Trimmed=448KB
04-22 21:57:10.613: E/GraphicsJNI(9570): VM won't let us allocate 5891496 bytes
値を送信するときのコードは次のとおりです。result.java
public class result extends Activity {
public static String destination = "";
検索.java
public void setButtonClickListener() {
Button searchButton = (Button)findViewById(R.id.buttonSearch);
searchButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
result.destination = textView.getText().toString();
TabHost tabHost = (TabHost) getParent().findViewById(android.R.id.tabhost);
tabHost.setCurrentTab(0);
}
});
}
私のアプリケーションは、3 つの異なるアクティビティでタブ ビューを使用していました。また、背景に .jpg を使用し、タブ内に画像ビューがあります。Android のこのプロセスには外部割り当てが大きすぎるからの回答を読みましたが、静かに理解できませんでした。誰かがそれを処理する方法を簡単に教えてもらえますか? またはどこで答えを探すべきですか?
送信値メモリの問題については、タブ間を移動し続けると同じエラーも表示されるため、タブ間の移動に問題がある可能性があると思います。