>I'm going to try to throw something together in python or C that does
>the number-crunching on the log.

Well, I'm as old as Mark Murphy for cris'sake, so I like to use AWK 
for things like this, which seemed a good idea until I remembered it 
doesn't support infix bitwise operators. Doh! Guess I'll have to 
learn something new sometime...

Oh well, I switched to gawk and did this "aeheap.awk" (android external heap):

BEGIN { FS=","; }

/I\/dvm_gc_info/ {
     print $0;
     print $4;
     innum = substr($4,1,length($4)-2);  # strip ] off end
     print innum;
     inlo = and( innum, 0xFFF );
     inhi = and( rshift(innum,12),0xFFF);
     print inlo, inhi;
     print "Alloc:", lshift( and(inlo,0x1ff),(rshift(inlo,9) * 4));
     print "Limit:", lshift( and(inhi,0x1ff),(rshift(inhi,9) * 4));
}
Used thusly:

adb logcat -b events -d | /opt/local/bin/gawk -f aeheap.awk -

I get output that agrees with your example at the end of

http://groups.google.com/group/android-developers/browse_thread/thread/6c90a2c70f3593f1/7974ba6fe0361e91?q=fadden+event+log#7974ba6fe0361e91

if I force the 0x783 value in.

A sample:

I/dvm_gc_info( 1868): 
[8320808730293606135,-8914445585825568708,-4006653253327009911,7862064]
7862064]
7862064
1840 1919
Alloc: 1245184
Limit: 1568768

If this seems rational, I will now take out the extra print 
statements and run this baby next time my app crashes with OOM.

Thanks

-- Ward

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

Reply via email to