What doses this mean:Heap message unsuccessfull in android
I have an app whose first page is simply a image with loading symbol. While testing the app, when never i click on home button after starting the app and then start the app again and repeating this at very fast rate i got the following run time exception:
08-15 05:47:53.555: INFO/ActivityManager(1146): Config changed: { scale=1.0 imsi=0/0 loc=en_IN touch=3 keys=1/1/2 nav=1/1 orien=2 layout=34}
08-15 05:47:53.655: WARN/InputManagerService(1146): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@45cc4df8
08-15 05:47:53.655: INFO/TouchPal(1248): density = 1.5
08-15 05:47:53.655: INFO/TouchPal(1248): scaledDensity = 1.5
08-15 05:47:53.655: INFO/TouchPal(1248): widthPixels = 854
08-15 05:47:53.655: INFO/TouchPal(1248): heightPixels = 480
08-15 05:47:53.655: INFO/TouchPal(1248): xdpi = 160.42105
08-15 05:47:53.655: INFO/TouchPal(1248): ydpi = 159.49706
08-15 05:47:53.655: INFO/TouchPal(1248): fontScale = 1.0
08-15 05:47:53.655: INFO/TouchPal(1248): hardKeyboardHidden = 2
08-15 05:47:53.655: INFO/TouchPal(1248): keyboard = 1
08-15 05:47:53.665: INFO/TouchPal(1248): keyboardHidden = 1
08-15 05:47:53.665: INFO/TouchPal(1248): navigation = 1
08-15 05:47:53.665: INFO/TouchPal(1248): orientation = 2
08-15 05:47:53.665: INFO/TouchPal(1248): touchscreen = 3
08-15 05:47:53.665: DEBUG/CompSplashWebViewClient(2528): onPageFinsihed/ For id: -1
08-15 05:47:53.665: DEBUG/CompSplashWebViewClient(2528): onPageFinsihed/ MAIN SCREEN URL HAS BEEN CACHED
08-15 05:47:53.665: DEBUG/FlipperController(2528): handleAction/ action : LOAD_MAIN_SCREEN
08-15 05:47:53.665: INFO/ActivityManager(1146): Starting activity: Intent { cmp=com.activities/.FlipperActivity }
08-15 05:47:53.665: INFO/TouchPal(1248): locale = English (India)
08-15 05:47:53.685: DEBUG/SplashScreenActivity(2528): onPause of BaseActivity
08-15 05:47:53.705: DEBUG/SplashScreenActivity(2528): Alarm Service Started
08-15 05:47:53.715: ERROR/TimeoutService(2528): onDestroy
08-15 05:47:53.745: DEBUG/FlipperActivity(2528): onCreate
Here this one:
08-15 05:47:53.925: ERROR/dalvikvm-heap(2528): Heap Massage needed (1728000-byte external allocation too big)
08-15 05:47:53.925: ERROR/dalvikvm-heap(2528): -->Full GC (don't collect SoftReferences)
08-15 05:47:53.985: DEBUG/dalvikvm(2528): GC freed 11520 objects / 655400 bytes in 59ms
08-15 05:47:53.985: DEBUG/dalvikvm(2528): threadid=207 wakeup: interrupted
08-15 05:47:53.985: ERROR/dalvikvm-heap(2528): -->Full GC (collect SoftReferences)
08-15 05:47:54.045: DEBUG/dalvikvm(2528): GC freed 453 objects / 210240 bytes in 53ms
What does this mean????
08-15 05:47:54.045: ERROR/dalvikvm-heap(2528): -->Heap Massage was unsuccessful for 1728000-bytes!
08-15 05:47:54.045: ERROR/dalvikvm-heap(2528): -->Heap Massage has failed...
08-15 05:47:54.045: DEBUG/AndroidRuntime(2528): Shutting down VM
08-15 05:47:54.045: WARN/dalvikvm(2528): threadid=3: thread exiting with uncaught exception (group=0x40023160)
08-15 05:47:54.045: ERROR/ACRA(2528): ACRA caught a RuntimeException exception for com.activities. Building report.
08-15 05:47:54.055: INFO/NotificationService(1146): enqueueToast pkg=com.activities callback=android.app.ITransientNotification$Stub$Proxy@45d31820 duration=1
08-15 05:47:54.075: DEBUG/ACRA(2528): Retrieve application default SharedPreferences.
08-15 05:47:54.095: INFO/global(2528): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
08-15 05:47:54.215: INFO/ACRA(2528): READ_LOGS not allowed. ACRA will not include LogCat and DropBox data.
08-15 05:47:54.565: DEBUG/dalvikvm(1146): GC freed 3519 objects / 195568 bytes in 93ms
08-15 05:47:54.745: DEBUG/dalvikvm(2528): GC freed 8487 objects / 518184 bytes in 65ms
08-15 05:47:54.985: DEBUG/dalvikvm(1146): GC freed 2087 objects / 106048 bytes in 92ms
08-15 05:47:55.235: DEBUG/dalvikvm(2528): GC freed 3220 objects / 159000 bytes in 66ms
08-15 05:47:55.375: DEBUG/dalvikvm(1146): GC freed 3682 objects / 155808 bytes in 93ms
08-15 05:47:55.425: DEBUG/ACRA(2528): Writing crash report file.
08-15 05:47:55.475: DEBUG/ACRA(2528): Mark all pending reports as approved.
08-15 05:47:55.475: DEBUG/ACRA(2528): Looking for error files in /data/data/com.activities/files
08-15 05:47:55.485: VERBOSE/ACRA(2528): About to start ReportSenderWorker from #handleException
08-15 05:47:55.485: DEBUG/ACRA(2528): Add user comment to null
08-15 05:47:55.485: DEBUG/ACRA(2528): #checkAndSendReports - start
08-15 05:47:55.485: DEBUG/ACRA(2528): Looking for error files in /data/data/com.activities/files
08-15 05:47:55.485: INFO/ACRA(2528): Sending file 1313387275000-approved.stacktrace
08-15 05:47:55.485: INFO/global(2528): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.
08-15 05:47:55.485: INFO/global(2528): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
08-15 05:47:55.535: DEBUG/ACRA(2528): Sending report 910c5203-3c48-4588-beae-73b126229487
08-15 05:47:55.535: DEBUG/ACRA(2528): Connect to https://spreadsheets.google.com/formResponse?formkey=**********
08-15 05:47:55.615: DEBUG/ACRA(2528): Setting httpPost headers
08-15 05:47:55.615: DEBUG/ACRA(2528): Sending request to https://spreadsheets.google.com/formResponse?****************
08-15 05:47:55.885: DEBUG/dalvikvm(1146): GC freed 2850 objects / 117392 bytes in 82ms
08-15 05:47:58.615: DEBUG/ACRA(2528): #checkAndSendReports - finish
What doses this exception means???
08-15 05:47:59.495: ERROR/ACRA(2528): Idol 2011 fatal error : Unable to start activity ComponentInfo{com.activities/com.activities.FlipperActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
08-15 05:47:59.495: ERROR/ACRA(2528): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.activities/com.activities.FlipperActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
08-15 05:47:59.495: ERROR/ACRA(2528): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2503)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.app.ActivityThread.access$2200(ActivityThread.java:123)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.os.Handler.dispatchMessage(Handler.java:99)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.os.Looper.loop(Looper.java:123)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.app.ActivityThread.main(ActivityThread.java:4370)
08-15 05:47:59.495: ERROR/ACRA(2528): at java.lang.reflect.Method.invokeNative(Native Method)
08-15 05:47:59.495: ERROR/ACRA(2528): at java.lang.reflect.Method.invoke(Method.java:521)
08-15 05:47:59.495: ERROR/ACRA(2528): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-15 05:47:59.495: ERROR/ACRA(2528): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-15 05:47:59.495: ERROR/ACRA(2528): at dalvik.system.NativeStart.main(Native Method)
08-15 05:47:59.495: ERROR/ACRA(2528): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
08-15 05:47:59.495: ERROR/ACRA(2528): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
08-15 05:47:59.495: ERROR/ACRA(2528): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
08-15 05:47:59.495: ERROR/ACRA(2528): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.app.Activity.setContentView(Activity.java:1625)
08-15 05:47:59.495: ERROR/ACRA(2528): at com.activities.FlipperActivity.onCreate(FlipperActivity.java:123)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2466)
08-15 05:47:59.495: ERROR/ACRA(2528): ... 11 more
08-15 05:47:59.495: ERROR/ACRA(2528): Caused by: java.lang.reflect.InvocationTargetException
08-15 05:47:59.495: ERROR/ACRA(2528): at android.widget.RelativeLayout.<init>(RelativeLayout.java:171)
08-15 05:47:59.495: ERROR/ACRA(2528): at java.lang.reflect.Constructor.constructNative(Native Method)
08-15 05:47:59.495: ERROR/ACRA(2528): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
08-15 05:47:59.495: ERROR/ACRA(2528): ... 21 more
08-15 05:47:59.495: ERROR/ACRA(2528): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
08-15 05:47:59.495: ERROR/ACRA(2528): at android.graphics.Bitmap.nativeCreate(Native Method)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:715)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.content.res.Resources.loadDrawable(Resources.java:1705)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.view.View.<init>(View.java:1873)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.view.View.<init>(View.java:1822)
08-15 05:47:59.495: ERROR/ACRA(2528): at android.view.ViewGroup.<init>(ViewGroup.开发者_如何学JAVAjava:307)
08-15 05:47:59.495: ERROR/ACRA(2528): ... 25 more
08-15 05:47:59.535: INFO/Process(2528): Sending signal. PID: 2528 SIG: 9
08-15 05:47:59.595: INFO/ActivityManager(1146): Process com.activities (pid 2528) has died.
08-15 05:47:59.595: WARN/ActivityManager(1146): Scheduling restart of crashed service com.activities/com.service.TimeoutService in 5000ms
08-15 05:47:59.595: INFO/WindowManager(1146): Setting rotation to 0, animFlags=0
08-15 05:47:59.615: DEBUG/ViewFlipper(1294): updateRunning() mVisible=false, mStarted=true, mUserPresent=true, mRunning=false
08-15 05:47:59.635: WARN/WindowManager(1146): Rebuild removed 4 windows but added 3
08-15 05:47:59.665: INFO/WindowManager(1146): WIN DEATH: Window{45c599a8 com.activities/com.activities.SplashScreenActivity paused=false}
08-15 05:47:59.705: INFO/ActivityManager(1146): Config changed: { scale=1.0 imsi=0/0 loc=en_IN touch=3 keys=1/1/2 nav=1/1 orien=1 layout=34}
08-15 05:47:59.705: INFO/TouchPal(1248): density = 1.5
08-15 05:47:59.705: INFO/TouchPal(1248): scaledDensity = 1.5
08-15 05:47:59.705: INFO/TouchPal(1248): widthPixels = 480
08-15 05:47:59.705: INFO/TouchPal(1248): heightPixels = 854
08-15 05:47:59.705: INFO/TouchPal(1248): xdpi = 160.42105
08-15 05:47:59.705: INFO/TouchPal(1248): ydpi = 159.49706
08-15 05:47:59.705: INFO/TouchPal(1248): fontScale = 1.0
08-15 05:47:59.705: INFO/TouchPal(1248): hardKeyboardHidden = 2
08-15 05:47:59.715: INFO/TouchPal(1248): keyboard = 1
08-15 05:47:59.715: INFO/TouchPal(1248): keyboardHidden = 1
08-15 05:47:59.715: INFO/TouchPal(1248): navigation = 1
08-15 05:47:59.715: INFO/TouchPal(1248): orientation = 1
08-15 05:47:59.715: INFO/TouchPal(1248): touchscreen = 3
08-15 05:47:59.715: INFO/TouchPal(1248): locale = English (India)
08-15 05:47:59.885: INFO/UsageStats(1146): Unexpected resume of com.android.launcher while already
Can any one explain to me what is happening here? What's weird to me is that this activity works most of the time.. And in the cases that it does crash on an out of memory error like above.
When the Activity is paused it is not freeing the Bitmap used for the image you are loading, so when it is reloaded you consume more and more memory, until your app runs out of the memory Android makes available to it (and you get the out of memory exception).
In your Activity's pause
method make sure you call Bitmap.recycle
on the Bitmap you are creating when you load the image. You may need to play with the lifecycle methods and figure out where best to free/release the memory allocated when the image is loaded, but that should fix your out of memory error.
精彩评论