I am making a SIP client using PortSIP library made based on AndroidSIPSample project. I get the following error:
01-09 02:00:52.730: A/libc(750): Fatal signal 11 (SIGSEGV) at 0x00000c0d (code=1), thread 750 (ovative.innovox)
The error is not coming when I am running AndroidSIPSample project downloaded from PortSIP website.
Following is my logcat output:
01-09 02:00:47.910: D/dalvikvm(750): Trying to load lib /data/app-lib/in.innovative.innovox-2/libportsipcore.so 0x416fc190
01-09 02:00:47.981: D/dalvikvm(750): Added shared lib /data/app-lib/in.innovative.innovox-2/libportsipcore.so 0x416fc190
01-09 02:00:48.400: D/dalvikvm(750): GC_FOR_ALLOC freed 63K, 8% free 2656K/2876K, paused 81ms, total 91ms
01-09 02:00:48.432: I/dalvikvm-heap(750): Grow heap (frag case) to 5.087MB for 2457616-byte allocation
01-09 02:00:48.510: D/dalvikvm(750): GC_FOR_ALLOC freed 2K, 5% free 5053K/5280K, paused 70ms, total 70ms
01-09 02:00:49.530: D/dalvikvm(750): GC_FOR_ALLOC freed 28K, 4% free 5351K/5540K, paused 53ms, total 57ms
01-09 02:00:49.550: I/dalvikvm-heap(750): Grow heap (frag case) to 6.451MB for 1127536-byte allocation
01-09 02:00:49.630: D/dalvikvm(750): GC_FOR_ALLOC freed 1K, 3% free 6450K/6644K, paused 73ms, total 73ms
01-09 02:00:51.990: I/Choreographer(750): Skipped 167 frames! The application may be doing too much work on its main thread.
01-09 02:00:52.010: D/gralloc_goldfish(750): Emulator without GPU emulation detected.
01-09 02:00:52.730: A/libc(750): Fatal signal 11 (SIGSEGV) at 0x00000c0d (code=1), thread 750 (ovative.innovox)
I don't know what is causing it, I even put images in xhdpi drawable folder for xhdpi devices according to this answer. But still getting the error.
Please help me solve this error.
I was getting the error because I was passing wrong argument to a method of the PortSIP library, so because of that the library was throwing error.
Related
I'm getting some non fatal errors on my logcat but no line numbers or anything else that can help me locate the error.
As you can see, I'm getting several, including Cursor finalized without prior close() and Window is full, but no idea how to find them.
09-26 14:20:47.743: W/CursorWindow(2090): Window is full: requested allocation 756 bytes, free space 150 bytes, window size 2097152 bytes
09-26 14:20:48.151: D/dalvikvm(2090): GC_FOR_ALLOC freed 1686K, 3% free 90204K/92076K, paused 108ms, total 112ms
09-26 14:20:48.159: W/CursorWrapperInner(2090): Cursor finalized without prior close()
09-26 14:20:48.163: W/CursorWrapperInner(2090): Cursor finalized without prior close()
09-26 14:20:49.759: D/dalvikvm(2090): GC_FOR_ALLOC freed 910K, 2% free 91343K/92436K, paused 115ms, total 115ms
09-26 14:20:51.127: D/dalvikvm(2090): GC_FOR_ALLOC freed 731K, 1% free 92661K/93576K, paused 70ms, total 70ms
09-26 14:20:52.195: D/dalvikvm(2090): GC_FOR_ALLOC freed 683K, 1% free 94024K/94892K, paused 71ms, total 71ms
09-26 14:20:53.303: D/dalvikvm(2090): GC_FOR_ALLOC freed 713K, 1% free 95360K/96256K, paused 77ms, total 77ms
09-26 14:20:54.403: D/dalvikvm(2090): GC_FOR_ALLOC freed 706K, 1% free 96702K/97592K, paused 84ms, total 84ms
09-26 14:20:54.755: W/CursorWindow(2090): Window is full: requested allocation 756 bytes, free space 645 bytes, window size 2097152 bytes
09-26 14:20:55.559: D/dalvikvm(2090): GC_FOR_ALLOC freed 752K, 1% free 98000K/98936K, paused 76ms, total 76ms
Any tips?
Thanks!
This kind of errors are not exceptions thrown by the program and will therefore not contain a stack-trace. As a general rule of thumb you may find ways to optimize your code by carefully reading the error message and read into the subject concerning the error.
As far as I can see it is a problem with allocation of memory. I don't think you can pinpoint them to a specific position in your execution flow since it will probably occur at different points in execution. You can think about your code to see if you can find some memory optimization possibilities.
If you want to analyze your code thoroughly you may want to use a tool like 'Eclipse MAT'. Read this tutorial to learn how to use the tool
Do a global file search looking for text like ".query(" in your .java files.
That should lead you to places where a Cursor is returned and from there you should be able to determine where they are not being closed.
in my simple app i am using 6 buttons and setting background with png.
Button btnGadgetmusic = (Button) findViewById(R.id.gadgetmusic);
btnGadgetmusic.setBackgroundResource(R.drawable.btnselectedsong);
minimum size of png is 13.5K and maximum size is 40K. When ever i try to run this app on emulator with version 2.3, i get "external allocation too large for this process" and interestningly if i run on honeycomb or on ICS then there is no problem.
So i am confused what should i do, should i ignore it, if not, do we have some better solution for that.
looking for your reply
EDIT Log File added
I/dalvikvm-heap(4190): Clamp target GC heap from 25.494MB to 24.000MB
D/dalvikvm(4190): GC_FOR_MALLOC freed <1K, 51% free 2647K/5379K, external 18806K/20812K, paused 28ms
D/dalvikvm(4190): GC_EXTERNAL_ALLOC freed <1K, 51% free 2647K/5379K, external 18806K/20812K, paused 49ms
I/dalvikvm-heap(4190): Clamp target GC heap from 25.833MB to 24.000MB
D/dalvikvm(4190): GC_FOR_MALLOC freed 0K, 51% free 2647K/5379K, external 19153K/20812K, paused 25ms
D/dalvikvm(4190): GC_EXTERNAL_ALLOC freed <1K, 51% free 2657K/5379K, external 19153K/20812K, paused 56ms
I/dalvikvm-heap(4190): Clamp target GC heap from 25.852MB to 24.000MB
D/dalvikvm(4190): GC_FOR_MALLOC freed <1K, 51% free 2657K/5379K, external 19162K/20812K, paused 24ms
D/dalvikvm(4190): GC_EXTERNAL_ALLOC freed 4K, 51% free 2671K/5379K, external 19162K/20812K, paused 69ms
I/dalvikvm-heap(4190): Clamp target GC heap from 25.887MB to 24.000MB
D/dalvikvm(4190): GC_FOR_MALLOC freed 0K, 51% free 2671K/5379K, external 19184K/20812K, paused 28ms
W/KeyCharacterMap(4190): No keyboard for id 0
W/KeyCharacterMap(4190): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
W/KeyCharacterMap(4190): No keyboard for id 0
W/KeyCharacterMap(4190): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
I/dalvikvm-heap(4190): Clamp target GC heap from 25.913MB to 24.000MB
D/dalvikvm(4190): GC_CONCURRENT freed 16K, 50% free 2697K/5379K, external 19184K/20812K, paused
3ms+35ms
I/dalvikvm-heap(4190): Clamp target GC heap from 25.942MB to 24.000MB
D/dalvikvm(4190): GC_CONCURRENT freed 13K, 50% free 2727K/5379K, external 19184K/20812K, paused 3ms+3ms
D/dalvikvm(4190): GC_EXTERNAL_ALLOC freed 2K, 50% free 2724K/5379K, external 19184K/20812K, paused 65ms
E/dalvikvm-heap(4190): 20736-byte external allocation too large for this process.
I/dalvikvm-heap(4190): Clamp target GC heap from 25.939MB to 24.000MB
E/GraphicsJNI(4190): VM won't let us allocate 20736 bytes
D/dalvikvm(4190): GC_FOR_MALLOC freed 0K, 50% free 2724K/5379K, external 19184K/20812K, paused 38ms
D/skia(4190): --- decoder->decode returned false
D/AndroidRuntime(4190): Shutting down VM
W/dalvikvm(4190): threadid=1: thread exiting with uncaught exception (group=0x40015560)
E/AndroidRuntime(4190): FATAL EXCEPTION: main
E/AndroidRuntime(4190): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
I have got a problem which is driving me wild. I used Google Map API V2 in my Code and when I'm moving the map I can see the following Logcat output (on Nexus 7):
01-23 21:17:10.724: D/dalvikvm(5484): GC_FOR_ALLOC freed 4531K, 21% free 12911K/16312K, paused 29ms, total 29ms
01-23 21:17:10.724: I/dalvikvm-heap(5484): Grow heap (frag case) to 13.043MB for 285724-byte allocation
01-23 21:17:10.744: D/dalvikvm(5484): GC_FOR_ALLOC freed 200K, 22% free 12990K/16592K, paused 25ms, total 25ms
01-23 21:17:12.074: D/dalvikvm(5484): GC_FOR_ALLOC freed 1326K, 23% free 12893K/16592K, paused 30ms, total 31ms
01-23 21:18:04.854: D/dalvikvm(5484): Debugger has detached; object registry had 1 entries
01-23 21:18:07.374: D/dalvikvm(5484): GC_FOR_ALLOC freed 658K, 23% free 12904K/16592K, paused 27ms, total 27ms
01-23 21:18:07.384: I/dalvikvm-heap(5484): Grow heap (frag case) to 13.763MB for 1048592-byte allocation
01-23 21:18:07.404: D/dalvikvm(5484): GC_FOR_ALLOC freed 2K, 21% free 13925K/17620K, paused 27ms, total 27ms
01-23 21:18:07.714: D/dalvikvm(5484): GC_FOR_ALLOC freed 2127K, 26% free 13054K/17620K, paused 29ms, total 29ms
01-23 21:18:44.694: D/dalvikvm(5484): GC_CONCURRENT freed 1894K, 27% free 12970K/17620K, paused 4ms+5ms, total 56ms
01-23 21:18:46.684: D/dalvikvm(5484): GC_CONCURRENT freed 1738K, 27% free 12996K/17620K, paused 4ms+2ms, total 53ms
01-23 21:18:49.254: D/dalvikvm(5484): GC_CONCURRENT freed 1756K, 27% free 13014K/17620K, paused 2ms+8ms, total 77ms
01-23 21:18:56.864: I/dalvikvm(5484): Jit: resizing JitTable from 8192 to 16384
01-23 21:18:56.934: D/dalvikvm(5484): GC_CONCURRENT freed 1840K, 21% free 13010K/16312K, paused 2ms+4ms, total 49ms
01-23 21:18:59.434: D/dalvikvm(5484): GC_CONCURRENT freed 1779K, 21% free 12995K/16312K, paused 4ms+5ms, total 50ms
01-23 21:19:03.414: D/dalvikvm(5484): GC_CONCURRENT freed 1781K, 21% free 13007K/16312K, paused 2ms+3ms, total 48ms
The heap keeps growing and growing and I have no idea what I can do about it. I searched through the web and through stackoverflow, but there was no helpful answer for me.
I hope someone of you can find the error. I am very new to Android, so please appreciate.
EDIT1: Heap Dump:
EDIT2: MAT Analysis
Suspect 1:
One instance of "maps.by.a" loaded by "dalvik.system.PathClassLoader # 0x4480cfa8" occupies 1.002.352 (22,33%) bytes. The memory is accumulated in one instance of "maps.by.d" loaded by "dalvik.system.PathClassLoader # 0x4480cfa8".
Keywords
maps.by.a
dalvik.system.PathClassLoader # 0x4480cfa8
maps.by.d
Suspect 2:
3.507 instances of "java.lang.Class", loaded by "<system class loader>" occupy 795.104 (17,72%) bytes.
Biggest instances:
•class com.ibm.icu4jni.util.Resources$DefaultTimeZones # 0x401fccc8 - 151.744 (3,38%) bytes.
•class android.text.Html$HtmlParser # 0x4016d288 - 126.592 (2,82%) bytes.
•class org.apache.harmony.security.fortress.Services # 0x40091188 - 51.456 (1,15%) bytes.
Keywords
java.lang.Class
Suspect 3:
8.168 instances of "java.lang.String", loaded by "<system class loader>" occupy 529.048 (11,79%) bytes.
Keywords
java.lang.String
First, your heap doesn't "keep growing". It is hovering between 12893K and 13054K, rising and falling, with one outlier peak at 13925K. Personally, I don't see anything in that log that would worry me.
Regarding your MAT output, if those are the three top culprits, none are surprising. The latter two say "I am writing an app for Android", as those are always there on any Android app. The first one indicates that Maps V2 has one rather pudgy object. Again, I see nothing in that output that would suggest a problem.
I am trying to setup a android virtual device to test syncing with an activesync-server.
I followed these steps:
The problem is that syncing is not working at all, but there are no errors like connection errors ...
IMO the problem is that the virtual device only has a private IP, so the server never can send anything to it?
So I probably need some kind of forwarding, like here:
But I am not sure if that’s correct and I am also not sure which ports should be forwarded.
Here is the logcat, when I want to sync:
W/InputMethodManagerService( 148): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#41302038 attribute=null
I/Choreographer( 274): Skipped 41 frames! The application may be doing too much work on its main thread.
D/dalvikvm( 477): GC_CONCURRENT freed 396K, 6% free 8392K/8903K, paused 15ms+7ms, total 527ms
D/dalvikvm( 274): GC_CONCURRENT freed 360K, 11% free 9493K/10567K, paused 29ms+48ms, total 142ms
I/EAS ContactsSyncAdapterService( 477): Contact sync requested for test#example.com
D/dalvikvm( 148): GREF has increased to 601
D/dalvikvm( 477): WAIT_FOR_CONCURRENT_GC blocked 0ms
I/Choreographer( 274): Skipped 33 frames! The application may be doing too much work on its main thread.
D/dalvikvm( 477): GC_EXPLICIT freed 333K, 7% free 8355K/8903K, paused 78ms+32ms, total 1269ms
I/EAS EmailSyncAdapterService( 477): performSync
I/EAS EmailSyncAdapterService( 477): Mail sync requested for test#example.com
D/dalvikvm( 460): WAIT_FOR_CONCURRENT_GC blocked 0ms
D/dalvikvm( 460): GC_EXPLICIT freed 216K, 5% free 8483K/8839K, paused 145ms+94ms, total 914ms
D/dalvikvm( 148): WAIT_FOR_CONCURRENT_GC blocked 0ms
D/dalvikvm( 148): GC_EXPLICIT freed 510K, 7% free 11338K/12167K, paused 8ms+35ms, total 323ms
D/dalvikvm( 274): GC_CONCURRENT freed 415K, 11% free 9486K/10567K, paused 25ms+28ms, total 125ms
E/Inbox[test#example.com]( 477): Uncaught exception in EasSyncServicejava.lang.ArrayIndexOutOfBoundsException: length=32; index=32
E/Inbox[test#example.com]( 477): Sync ended due to an exception.
D/dalvikvm( 477): GC_CONCURRENT freed 376K, 6% free 8420K/8903K, paused 5ms+18ms, total 66ms
I don't think this is a problem with your networking setup. It looks like you have an error in your Sync code, that is causing the process to stop:
E/Inboxtest#example.com: Uncaught exception in EasSyncServicejava.lang.ArrayIndexOutOfBoundsException: length=32; index=32
E/Inboxtest#example.com: Sync ended due to an exception.
>
Wrap this code in a try/catch block to understand what is happening better.
I see a lot of this:
06-19 17:29:11.911: DEBUG/dalvikvm(10028): GC_FOR_MALLOC freed 729K, 54% free 3490K/7431K, external 0K/512K, paused 39ms
06-19 17:29:11.941: DEBUG/dalvikvm(10028): GC_FOR_MALLOC freed <1K, 49% free 3855K/7431K, external 0K/512K, paused 29ms
repeatedly in the log. Is there a way to not show the Dalvik debug messages?
Simply set a logcat filter. You can do this graphically in Eclipse as well.