On Jan 13, 11:42 am, blindfold <seeingwithso...@gmail.com> wrote:
> > What log messages appear when this happens?

Okay, nothing really useful there.

Next thing to look at is the event log.  You can retrieve it like
this:

% adb logcat -b events -d > events.txt

It has a bunch of lines like this (I got these by launching the maps
app and moving around):

I/dvm_gc_info(  251):
[3345437233800423062,-8939501051664840672,-4017067827465291884,7345919]
I/dvm_gc_info(  251):
[3345437233800210049,-8975529848683808736,-4014816027651606636,7878499]
I/dvm_gc_info(  251):
[3345437233800193621,-9025069444584888331,-4014534552674895980,7878531]
I/dvm_gc_madvise_info(  251): [573440,237568]

The meaning of the numbers is described in dalvik/vm/alloc/
HeapDebug.c.  The interesting part for the moment is the fourth
number.  Looking at the last line, 7878531 is 783783 in hex (which is
numerically a little spooky).  Taking the low 24 bits and splitting it
into two 12-bit values gives 0x783 for both "external byte limit" and
"external bytes allocated".  These are 12-bit floating point values;
performing the float12ToInt() calculation in gdb:

(gdb) print (0x783 & 0x1ff) << ((0x783 >> 9) * 4)
$5 = 1585152

Which means "maps" has 1.58MB of external allocations, and they're
currently filling the "external heap".

The code in dalvik/vm/alloc/HeapSource.c externalAlloc() will expand
the limit (a/k/a grow the heap) as needed, assuming there's sufficient
free space.  This only happens if externalAllocPossible() returns
true, which it does if the sum total of virtual heap usage and
"external" usage is less than the maximum allowed heap size.

There's a way to make DDMS pretty-print / graph the event log output,
using the Event Log tab, but I haven't tried it in a while.

Anyway.  Try doing the above on the last dvm_gc_info line for your
process in the event log after the crash and see what the numbers look
like.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to