-2

これは私のアプリのlogcatです

  07-11 11:31:25.269: D/-heap(6666): GC_FOR_ALLOC freed 1256K, 13% free 28316K/32227K, paused 34ms
  07-11 11:31:25.309: D/-heap(6666): GC_BEFORE_OOM freed 414K, 14% free 27901K/32227K, paused 42ms
  07-11 11:31:25.309: E/dalvikvm-heap(6666): Out of memory on a 20155408-byte allocation.
  07-11 11:31:25.309: I/dalvikvm(6666): "main" prio=5 tid=1 RUNNABLE
  07-11 11:31:25.309: I/dalvikvm(6666):   | group="main" sCount=0 dsCount=0 obj=0x40b01c58 self=0x1640e80
  07-11 11:31:25.309: I/dalvikvm(6666):   | sysTid=6666 nice=0 sched=0/0 cgrp=default handle=1074922856
  07-11 11:31:25.319: I/dalvikvm(6666):   | schedstat=( 0 0 0 ) utm=351 stm=36 core=0
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:500)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:306)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:331)
  07-11 11:31:25.319: I/dalvikvm(6666):   at com.callplanets.chat.ui.Talk$DiscussArrayAdapter.getView(Talk.java:939)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.AbsListView.obtainView(AbsListView.java:2045)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.ListView.makeAndAddView(ListView.java:1772)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.ListView.fillUp(ListView.java:705)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.ListView.correctTooHigh(ListView.java:1395)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.ListView.fillSpecific(ListView.java:1333)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.ListView.layoutChildren(ListView.java:1615)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.AbsListView.onLayout(AbsListView.java:1875)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.view.View.layout(View.java:11390)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.view.ViewGroup.layout(ViewGroup.java:4332)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.RelativeLayout.onLayout(RelativeLayout.java:930)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.view.View.layout(View.java:11390)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.view.ViewGroup.layout(ViewGroup.java:4332)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.FrameLayout.onLayout(FrameLayout.java:444)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.view.View.layout(View.java:11390)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.view.ViewGroup.layout(ViewGroup.java:4332)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1653)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1511)
  07-11 11:31:25.319: I/dalvikvm(6666):   at android.widget.LinearLayout.onLayout(LinearLayout.java:1416)
  07-11 11:31:25.329: I/dalvikvm(6666):   at android.view.View.layout(View.java:11390)
  07-11 11:31:25.329: I/dalvikvm(6666):   at android.view.ViewGroup.layout(ViewGroup.java:4332)
  07-11 11:31:25.329: I/dalvikvm(6666):   at android.widget.FrameLayout.onLayout(FrameLayout.java:444)
  07-11 11:31:25.329: I/dalvikvm(6666):   at android.view.View.layout(View.java:11390)
  07-11 11:31:25.329: I/dalvikvm(6666):   at android.view.ViewGroup.layout(ViewGroup.java:4332)
  07-11 11:31:25.329: I/dalvikvm(6666):   at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1490)
  07-11 11:31:25.329: I/dalvikvm(6666):   at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2455)
  07-11 11:31:25.329: I/dalvikvm(6666):   at android.os.Handler.dispatchMessage(Handler.java:99)
  07-11 11:31:25.329: I/dalvikvm(6666):   at android.os.Looper.loop(Looper.java:137)
  07-11 11:31:25.329: I/dalvikvm(6666):   at android.app.ActivityThread.main(ActivityThread.java:4424)
  07-11 11:31:25.329: I/dalvikvm(6666):   at java.lang.reflect.Method.invokeNative(Native Method)
  07-11 11:31:25.329: I/dalvikvm(6666):   at java.lang.reflect.Method.invoke(Method.java:511)
  07-11 11:31:25.329: I/dalvikvm(6666):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
  07-11 11:31:25.329: I/dalvikvm(6666):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
  07-11 11:31:25.329: I/dalvikvm(6666):   at dalvik.system.NativeStart.main(Native Method)
  07-11 11:31:26.399: E/dalvikvm(6666): can't open /data/misc/hprof_oom_dump.hprof: Permission denied
  07-11 11:31:26.419: D/-heap(6666): Dump of hprof is not done
  07-11 11:31:26.419: D/skia(6666): --- decoder->decode returned false
  07-11 11:31:26.419: W/dalvikvm(6666): threadid=1: thread exiting with uncaught exception (group=0x40b009f0)
  07-11 11:31:26.429: E/AndroidRuntime(6666): FATAL EXCEPTION: main
  07-11 11:31:26.429: E/AndroidRuntime(6666): java.lang.OutOfMemoryError
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:500)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:306)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:331)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at com.callplanets.chat.ui.Talk$DiscussArrayAdapter.getView(Talk.java:939)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.AbsListView.obtainView(AbsListView.java:2045)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.ListView.makeAndAddView(ListView.java:1772)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.ListView.fillUp(ListView.java:705)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.ListView.correctTooHigh(ListView.java:1395)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.ListView.fillSpecific(ListView.java:1333)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.ListView.layoutChildren(ListView.java:1615)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.AbsListView.onLayout(AbsListView.java:1875)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.View.layout(View.java:11390)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.ViewGroup.layout(ViewGroup.java:4332)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.RelativeLayout.onLayout(RelativeLayout.java:930)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.View.layout(View.java:11390)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.ViewGroup.layout(ViewGroup.java:4332)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.FrameLayout.onLayout(FrameLayout.java:444)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.View.layout(View.java:11390)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.ViewGroup.layout(ViewGroup.java:4332)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1653)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1511)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.LinearLayout.onLayout(LinearLayout.java:1416)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.View.layout(View.java:11390)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.ViewGroup.layout(ViewGroup.java:4332)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.widget.FrameLayout.onLayout(FrameLayout.java:444)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.View.layout(View.java:11390)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.ViewGroup.layout(ViewGroup.java:4332)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1490)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2455)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.os.Handler.dispatchMessage(Handler.java:99)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.os.Looper.loop(Looper.java:137)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at android.app.ActivityThread.main(ActivityThread.java:4424)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at java.lang.reflect.Method.invokeNative(Native Method)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at java.lang.reflect.Method.invoke(Method.java:511)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
  07-11 11:31:26.429: E/AndroidRuntime(6666):   at dalvik.system.NativeStart.main(Native Method)

これらは主な例外です: 07-11 11:31:25.309: E/dalvikvm-heap(6666): 20155408 バイトの割り当てでメモリが不足しています。07-11 11:31:26.399: E/dalvikvm(6666): /data/misc/hprof_oom_dump.hprof を開けません: アクセス許可が拒否されました

これらの問題を解決するにはどうすればよいですか? 伝えてください....

ギャラリーから選んだ画像のサムネイルを表示するアクティビティがあります。サムネイルをクリックすると、ユーザーは別のアクティビティに移動し、通常のサイズで表示されます。

2 番目のアクティビティの裏側で、​​この例外が発生します。

4

1 に答える 1

1

画像のサイズを縮小/スケーリングすることで、メモリ不足の例外を取り除くことができます。これを試してください

BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 8; Bitmap receipt = BitmapFactory.decodeFile(photo.toString(),options); //From File You can customise on your needs.

于 2013-07-11T06:16:17.143 に答える