- 浏览: 706134 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
utyujin:
作者你好,首先自我注释一下我是一名UI设计师,最近在写关于屏幕 ...
android中的dp,px深度解析 -
eagledame:
<data android:scheme="p ...
Android利用系统广播---监听应用程序安装和卸载[转] -
圣经未来:
虽然帖子距今已有三年,但是我还是来评论一下。对于这段话: 这句 ...
android中的dp,px深度解析 -
passerby_whu:
如果Activity中已经有了很多id了。怎么样保证你指定的i ...
Android Layout 之 RelativeLayout,代码实现相对布局 -
passerby_whu:
u013023750 写道楼主你好 ...
android中的dp,px深度解析
解决android项目系统崩溃:Exceptions are not yet supported across processes.
- 博客分类:
- android
目前在开发一个android项目,其中有一个功能是读取联系人。我是一次性的联系人全部读出来,当联系人数量较少时,几十条,没有问题,超过200条时,则遇到问题是:项目每开启二次,就会崩溃一次,然后就这样下去。这个问题已经存在了好久,就是找不到症结。主要抛出的异常信息为: ERROR/JavaBinder(3438): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
ERROR/JavaBinder(3438): java.lang.RuntimeException: No memory in memObj
部分日志信息显示如下:
12-06 10:14:33.825: INFO/ActivityManager(148): Starting activity: Intent { cmp=com.justel.activity/.ContactShowActivity (has extras) }
12-06 10:14:34.476: DEBUG/dalvikvm(16889): GC_EXPLICIT freed 3976 objects / 151640 bytes in 36ms
12-06 10:14:34.595: DEBUG/dalvikvm(148): GC_EXPLICIT freed 4323 objects / 204992 bytes in 106ms
12-06 10:14:34.775: DEBUG/dalvikvm(3438): GC_EXPLICIT freed 2906 objects / 142256 bytes in 50ms
12-06 10:14:34.895: ERROR/IMemory(3438): cannot dup fd=1023, size=1048576, err=0 (Too many open files)
12-06 10:14:34.895: ERROR/IMemory(3438): cannot map BpMemoryHeap (binder=0x356890), size=1048576, fd=-1 (Bad file number)
12-06 10:14:34.895: ERROR/JavaBinder(3438): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
12-06 10:14:34.895: ERROR/JavaBinder(3438): java.lang.RuntimeException: No memory in memObj
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.database.CursorWindow.native_init(Native Method)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.database.CursorWindow.<init>(CursorWindow.java:518)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.database.CursorWindow.<init>(CursorWindow.java:27)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:493)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:496)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:108)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.os.Binder.execTransact(Binder.java:288)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at dalvik.system.NativeStart.run(Native Method)
12-06 10:14:38.855: WARN/ResourceType(148): Skipping entry 0x7f040000 in package table 0 because it is not complex!
12-06 10:14:38.865: WARN/ResourceType(148): Skipping entry 0x7f040001 in package table 0 because it is not complex!
12-06 10:14:43.835: WARN/ActivityManager(148): Launch timeout has expired, giving up wake lock!
12-06 10:14:43.868: WARN/ActivityManager(148): Activity idle timeout for HistoryRecord{465eb1a0 com.justel.activity/.ContactShowActivity}
12-06 10:14:48.945: DEBUG/dalvikvm(12927): GC_EXPLICIT freed 339 objects / 22016 bytes in 75ms
12-06 10:14:55.565: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 4->3
12-06 10:15:01.565: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 3->4
12-06 10:15:15.645: DEBUG/dalvikvm(396): GC_EXPLICIT freed 3326 objects / 229504 bytes in 81ms
12-06 10:15:16.665: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21567 objects / 524416 bytes in 56ms
12-06 10:15:21.655: DEBUG/dalvikvm(344): GC_EXPLICIT freed 1898 objects / 291336 bytes in 81ms
12-06 10:15:21.655: DEBUG/NativeCrypto(344): Freeing OpenSSL session
12-06 10:15:25.565: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 4->3
12-06 10:15:30.656: DEBUG/dalvikvm(14162): GC_EXPLICIT freed 6797 objects / 367488 bytes in 80ms
12-06 10:15:32.076: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 3->4
12-06 10:15:43.175: DEBUG/dalvikvm(16681): GC_EXPLICIT freed 1577 objects / 101992 bytes in 88ms
12-06 10:15:46.825: DEBUG/HtcLockScreen(148): onRefreshBatteryInfo showBatteryInfo:truepluggedIn:truebatteryLevel:83
12-06 10:15:46.825: DEBUG/HtcLockScreen(148): onRefreshBatteryInfo currentData mPluggedIn:truemBatteryLevel:82
12-06 10:15:46.825: INFO/HtcLockScreen(148): updateStatusViewByPriority, mIsSimCheckView = false, mIsBatteryInfo = false, mIsMusicPlaying = false, mIsAirPlaneMode = false
12-06 10:15:46.835: INFO/global(148): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
12-06 10:15:46.835: INFO/global(148): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
12-06 10:15:46.845: DEBUG/BatteryService(148): isUsbConnected() = true
12-06 10:15:46.845: DEBUG/BatteryService(148): mPlugType = 2
12-06 10:15:46.865: ERROR/Tethering(148): attempting to remove unknown iface (usb0), ignoring
12-06 10:15:46.865: DEBUG/WifiService(148): ACTION_BATTERY_CHANGED pluggedType: 2
12-06 10:15:46.875: DEBUG/UsbConnectedReceiver(396): action = psclient.intent.action.usb_status
12-06 10:15:46.875: INFO/fdhttpd(16828): battery level:83 plugged:2
12-06 10:15:46.875: DEBUG/nicolas(16828): onUsbChange
12-06 10:15:46.875: DEBUG/nicolas(16828): 2
12-06 10:15:46.875: DEBUG/nicolas(16828): Begin onReceive->_startService
12-06 10:15:46.875: DEBUG/nicolas(16828): End onReceive->_startService
12-06 10:15:46.875: DEBUG/UsbConnectedReceiver(396): ACTION_BATTERY_CHANGED
12-06 10:15:46.875: DEBUG/UsbConnectedReceiver(396): usbCurrentType = 2
12-06 10:15:46.875: DEBUG/UsbConnectedReceiver(396): Current type is same as previous, return!
12-06 10:16:00.166: DEBUG/PowerManagerService(148): New lightsensor value:90, lcdValue:160
12-06 10:16:04.196: DEBUG/PowerManagerService(148): New lightsensor value:40, lcdValue:160
12-06 10:16:07.135: DEBUG/dalvikvm(16691): GC_EXPLICIT freed 4978 objects / 277200 bytes in 61ms
12-06 10:16:12.165: DEBUG/dalvikvm(586): GC_EXPLICIT freed 347 objects / 13256 bytes in 98ms
12-06 10:16:19.215: DEBUG/dalvikvm(277): GC_EXPLICIT freed 5022 objects / 385392 bytes in 130ms
12-06 10:16:20.385: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21574 objects / 524128 bytes in 68ms
12-06 10:16:53.085: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 4->3
12-06 10:17:02.086: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 3->4
12-06 10:17:24.076: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21574 objects / 524312 bytes in 77ms
12-06 10:17:58.736: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 4->3
12-06 10:18:04.745: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 3->4
12-06 10:18:18.886: DEBUG/dalvikvm(277): GC_EXPLICIT freed 1752 objects / 102696 bytes in 138ms
12-06 10:18:27.485: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21561 objects / 524288 bytes in 87ms
12-06 10:19:30.795: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21579 objects / 524256 bytes in 70ms
12-06 10:20:00.115: DEBUG/HtcLockScreen(148): onRefreshBatteryInfo showBatteryInfo:truepluggedIn:truebatteryLevel:84
12-06 10:20:00.115: DEBUG/HtcLockScreen(148): onRefreshBatteryInfo currentData mPluggedIn:truemBatteryLevel:83
12-06 10:20:00.115: INFO/HtcLockScreen(148): updateStatusViewByPriority, mIsSimCheckView = false, mIsBatteryInfo = false, mIsMusicPlaying = false, mIsAirPlaneMode = false
12-06 10:20:00.125: INFO/global(148): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
12-06 10:20:00.135: INFO/global(148): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
12-06 10:20:00.145: DEBUG/BatteryService(148): isUsbConnected() = true
12-06 10:20:00.145: DEBUG/BatteryService(148): mPlugType = 2
12-06 10:20:00.145: INFO/fdhttpd(16828): battery level:84 plugged:2
12-06 10:20:00.255: DEBUG/dalvikvm(148): JIT code cache reset in 8 ms (1048488 bytes 28/0)
12-06 10:20:00.265: DEBUG/dalvikvm(148): GC_FOR_MALLOC freed 29488 objects / 1394608 bytes in 118ms
12-06 10:20:00.265: ERROR/Tethering(148): attempting to remove unknown iface (usb0), ignoring
12-06 10:20:00.275: DEBUG/WifiService(148): ACTION_BATTERY_CHANGED pluggedType: 2
12-06 10:20:00.355: DEBUG/nicolas(16828): onUsbChange
12-06 10:20:00.365: DEBUG/UsbConnectedReceiver(396): action = psclient.intent.action.usb_status
12-06 10:20:00.395: DEBUG/nicolas(16828): 2
12-06 10:20:00.395: DEBUG/nicolas(16828): Begin onReceive->_startService
12-06 10:20:00.405: DEBUG/nicolas(16828): End onReceive->_startService
12-06 10:20:00.405: DEBUG/UsbConnectedReceiver(396): ACTION_BATTERY_CHANGED
12-06 10:20:00.405: DEBUG/UsbConnectedReceiver(396): usbCurrentType = 2
12-06 10:20:00.416: DEBUG/UsbConnectedReceiver(396): Current type is same as previous, return!
12-06 10:20:06.885: DEBUG/dalvikvm(277): GC_EXPLICIT freed 997 objects / 68104 bytes in 121ms
12-06 10:20:34.536: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21563 objects / 524248 bytes in 82ms
12-06 10:20:51.525: DEBUG/AndroidRuntime(16889): Shutting down VM
12-06 10:20:51.535: WARN/dalvikvm(16889): threadid=1: thread exiting with uncaught exception (group=0x400259f8)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): FATAL EXCEPTION: main
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.justel.activity/com.justel.activity.ContactShowActivity}: java.lang.NullPointerException: println needs a message
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.app.ActivityThread.access$2300(ActivityThread.java:135)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.os.Handler.dispatchMessage(Handler.java:99)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.os.Looper.loop(Looper.java:144)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.app.ActivityThread.main(ActivityThread.java:4937)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at java.lang.reflect.Method.invokeNative(Native Method)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at java.lang.reflect.Method.invoke(Method.java:521)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at dalvik.system.NativeStart.main(Native Method)
看来是内存泄漏了,可就找不到问题出在哪里。怀疑是查询sqlite数据库时没有关闭Cursor,看了下代码Cursor是在finally{}代码块中关闭的,没问题。问题究竟出在哪里,后来通过仔细查看代码,原来我在查询联系人时用了两层游标,我只关闭了外层游标,没有关闭里层的,导致内存资源没有被释放。多次运行后,系统资源被耗尽。
这个其实比较简单,在每次for循环里面结束后,把游标关掉。记住一点,游标每打开一次,都要关掉一次,因为它不会自动关掉!还有在Activity中也提供了对游标的管理,关掉游标等任务由Activity托管,具体我没用过,你可以查查。有问题再交流。
英雄所见略同,呵呵。
ERROR/JavaBinder(3438): java.lang.RuntimeException: No memory in memObj
部分日志信息显示如下:
12-06 10:14:33.825: INFO/ActivityManager(148): Starting activity: Intent { cmp=com.justel.activity/.ContactShowActivity (has extras) }
12-06 10:14:34.476: DEBUG/dalvikvm(16889): GC_EXPLICIT freed 3976 objects / 151640 bytes in 36ms
12-06 10:14:34.595: DEBUG/dalvikvm(148): GC_EXPLICIT freed 4323 objects / 204992 bytes in 106ms
12-06 10:14:34.775: DEBUG/dalvikvm(3438): GC_EXPLICIT freed 2906 objects / 142256 bytes in 50ms
12-06 10:14:34.895: ERROR/IMemory(3438): cannot dup fd=1023, size=1048576, err=0 (Too many open files)
12-06 10:14:34.895: ERROR/IMemory(3438): cannot map BpMemoryHeap (binder=0x356890), size=1048576, fd=-1 (Bad file number)
12-06 10:14:34.895: ERROR/JavaBinder(3438): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
12-06 10:14:34.895: ERROR/JavaBinder(3438): java.lang.RuntimeException: No memory in memObj
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.database.CursorWindow.native_init(Native Method)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.database.CursorWindow.<init>(CursorWindow.java:518)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.database.CursorWindow.<init>(CursorWindow.java:27)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:493)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:496)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:108)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at android.os.Binder.execTransact(Binder.java:288)
12-06 10:14:34.895: ERROR/JavaBinder(3438): at dalvik.system.NativeStart.run(Native Method)
12-06 10:14:38.855: WARN/ResourceType(148): Skipping entry 0x7f040000 in package table 0 because it is not complex!
12-06 10:14:38.865: WARN/ResourceType(148): Skipping entry 0x7f040001 in package table 0 because it is not complex!
12-06 10:14:43.835: WARN/ActivityManager(148): Launch timeout has expired, giving up wake lock!
12-06 10:14:43.868: WARN/ActivityManager(148): Activity idle timeout for HistoryRecord{465eb1a0 com.justel.activity/.ContactShowActivity}
12-06 10:14:48.945: DEBUG/dalvikvm(12927): GC_EXPLICIT freed 339 objects / 22016 bytes in 75ms
12-06 10:14:55.565: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 4->3
12-06 10:15:01.565: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 3->4
12-06 10:15:15.645: DEBUG/dalvikvm(396): GC_EXPLICIT freed 3326 objects / 229504 bytes in 81ms
12-06 10:15:16.665: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21567 objects / 524416 bytes in 56ms
12-06 10:15:21.655: DEBUG/dalvikvm(344): GC_EXPLICIT freed 1898 objects / 291336 bytes in 81ms
12-06 10:15:21.655: DEBUG/NativeCrypto(344): Freeing OpenSSL session
12-06 10:15:25.565: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 4->3
12-06 10:15:30.656: DEBUG/dalvikvm(14162): GC_EXPLICIT freed 6797 objects / 367488 bytes in 80ms
12-06 10:15:32.076: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 3->4
12-06 10:15:43.175: DEBUG/dalvikvm(16681): GC_EXPLICIT freed 1577 objects / 101992 bytes in 88ms
12-06 10:15:46.825: DEBUG/HtcLockScreen(148): onRefreshBatteryInfo showBatteryInfo:truepluggedIn:truebatteryLevel:83
12-06 10:15:46.825: DEBUG/HtcLockScreen(148): onRefreshBatteryInfo currentData mPluggedIn:truemBatteryLevel:82
12-06 10:15:46.825: INFO/HtcLockScreen(148): updateStatusViewByPriority, mIsSimCheckView = false, mIsBatteryInfo = false, mIsMusicPlaying = false, mIsAirPlaneMode = false
12-06 10:15:46.835: INFO/global(148): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
12-06 10:15:46.835: INFO/global(148): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
12-06 10:15:46.845: DEBUG/BatteryService(148): isUsbConnected() = true
12-06 10:15:46.845: DEBUG/BatteryService(148): mPlugType = 2
12-06 10:15:46.865: ERROR/Tethering(148): attempting to remove unknown iface (usb0), ignoring
12-06 10:15:46.865: DEBUG/WifiService(148): ACTION_BATTERY_CHANGED pluggedType: 2
12-06 10:15:46.875: DEBUG/UsbConnectedReceiver(396): action = psclient.intent.action.usb_status
12-06 10:15:46.875: INFO/fdhttpd(16828): battery level:83 plugged:2
12-06 10:15:46.875: DEBUG/nicolas(16828): onUsbChange
12-06 10:15:46.875: DEBUG/nicolas(16828): 2
12-06 10:15:46.875: DEBUG/nicolas(16828): Begin onReceive->_startService
12-06 10:15:46.875: DEBUG/nicolas(16828): End onReceive->_startService
12-06 10:15:46.875: DEBUG/UsbConnectedReceiver(396): ACTION_BATTERY_CHANGED
12-06 10:15:46.875: DEBUG/UsbConnectedReceiver(396): usbCurrentType = 2
12-06 10:15:46.875: DEBUG/UsbConnectedReceiver(396): Current type is same as previous, return!
12-06 10:16:00.166: DEBUG/PowerManagerService(148): New lightsensor value:90, lcdValue:160
12-06 10:16:04.196: DEBUG/PowerManagerService(148): New lightsensor value:40, lcdValue:160
12-06 10:16:07.135: DEBUG/dalvikvm(16691): GC_EXPLICIT freed 4978 objects / 277200 bytes in 61ms
12-06 10:16:12.165: DEBUG/dalvikvm(586): GC_EXPLICIT freed 347 objects / 13256 bytes in 98ms
12-06 10:16:19.215: DEBUG/dalvikvm(277): GC_EXPLICIT freed 5022 objects / 385392 bytes in 130ms
12-06 10:16:20.385: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21574 objects / 524128 bytes in 68ms
12-06 10:16:53.085: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 4->3
12-06 10:17:02.086: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 3->4
12-06 10:17:24.076: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21574 objects / 524312 bytes in 77ms
12-06 10:17:58.736: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 4->3
12-06 10:18:04.745: INFO/BatteryStatsImpl(148): notePhoneSignalStrengthLocked: 3->4
12-06 10:18:18.886: DEBUG/dalvikvm(277): GC_EXPLICIT freed 1752 objects / 102696 bytes in 138ms
12-06 10:18:27.485: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21561 objects / 524288 bytes in 87ms
12-06 10:19:30.795: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21579 objects / 524256 bytes in 70ms
12-06 10:20:00.115: DEBUG/HtcLockScreen(148): onRefreshBatteryInfo showBatteryInfo:truepluggedIn:truebatteryLevel:84
12-06 10:20:00.115: DEBUG/HtcLockScreen(148): onRefreshBatteryInfo currentData mPluggedIn:truemBatteryLevel:83
12-06 10:20:00.115: INFO/HtcLockScreen(148): updateStatusViewByPriority, mIsSimCheckView = false, mIsBatteryInfo = false, mIsMusicPlaying = false, mIsAirPlaneMode = false
12-06 10:20:00.125: INFO/global(148): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
12-06 10:20:00.135: INFO/global(148): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
12-06 10:20:00.145: DEBUG/BatteryService(148): isUsbConnected() = true
12-06 10:20:00.145: DEBUG/BatteryService(148): mPlugType = 2
12-06 10:20:00.145: INFO/fdhttpd(16828): battery level:84 plugged:2
12-06 10:20:00.255: DEBUG/dalvikvm(148): JIT code cache reset in 8 ms (1048488 bytes 28/0)
12-06 10:20:00.265: DEBUG/dalvikvm(148): GC_FOR_MALLOC freed 29488 objects / 1394608 bytes in 118ms
12-06 10:20:00.265: ERROR/Tethering(148): attempting to remove unknown iface (usb0), ignoring
12-06 10:20:00.275: DEBUG/WifiService(148): ACTION_BATTERY_CHANGED pluggedType: 2
12-06 10:20:00.355: DEBUG/nicolas(16828): onUsbChange
12-06 10:20:00.365: DEBUG/UsbConnectedReceiver(396): action = psclient.intent.action.usb_status
12-06 10:20:00.395: DEBUG/nicolas(16828): 2
12-06 10:20:00.395: DEBUG/nicolas(16828): Begin onReceive->_startService
12-06 10:20:00.405: DEBUG/nicolas(16828): End onReceive->_startService
12-06 10:20:00.405: DEBUG/UsbConnectedReceiver(396): ACTION_BATTERY_CHANGED
12-06 10:20:00.405: DEBUG/UsbConnectedReceiver(396): usbCurrentType = 2
12-06 10:20:00.416: DEBUG/UsbConnectedReceiver(396): Current type is same as previous, return!
12-06 10:20:06.885: DEBUG/dalvikvm(277): GC_EXPLICIT freed 997 objects / 68104 bytes in 121ms
12-06 10:20:34.536: DEBUG/dalvikvm(3450): GC_FOR_MALLOC freed 21563 objects / 524248 bytes in 82ms
12-06 10:20:51.525: DEBUG/AndroidRuntime(16889): Shutting down VM
12-06 10:20:51.535: WARN/dalvikvm(16889): threadid=1: thread exiting with uncaught exception (group=0x400259f8)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): FATAL EXCEPTION: main
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.justel.activity/com.justel.activity.ContactShowActivity}: java.lang.NullPointerException: println needs a message
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.app.ActivityThread.access$2300(ActivityThread.java:135)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.os.Handler.dispatchMessage(Handler.java:99)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.os.Looper.loop(Looper.java:144)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at android.app.ActivityThread.main(ActivityThread.java:4937)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at java.lang.reflect.Method.invokeNative(Native Method)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at java.lang.reflect.Method.invoke(Method.java:521)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-06 10:20:51.595: ERROR/AndroidRuntime(16889): at dalvik.system.NativeStart.main(Native Method)
看来是内存泄漏了,可就找不到问题出在哪里。怀疑是查询sqlite数据库时没有关闭Cursor,看了下代码Cursor是在finally{}代码块中关闭的,没问题。问题究竟出在哪里,后来通过仔细查看代码,原来我在查询联系人时用了两层游标,我只关闭了外层游标,没有关闭里层的,导致内存资源没有被释放。多次运行后,系统资源被耗尽。
评论
5 楼
xbting
2012-06-26
4 楼
亚当爱上java
2011-07-23
zhaopian16 写道
呵呵,lz好,很不幸的我也遇到你类似的问题了,关键是我现在游标不能关掉,关掉需要一定的条件才可以,不知你的问题后来使用什么方法解决的,能大致介绍下吗,谢谢了!!!
zhaopian16 写道
呵呵,lz好,很不幸的我也遇到你类似的问题了,关键是我现在游标不能关掉,关掉需要一定的条件才可以,不知你的问题后来使用什么方法解决的,能大致介绍下吗,谢谢了!!!
这个其实比较简单,在每次for循环里面结束后,把游标关掉。记住一点,游标每打开一次,都要关掉一次,因为它不会自动关掉!还有在Activity中也提供了对游标的管理,关掉游标等任务由Activity托管,具体我没用过,你可以查查。有问题再交流。
3 楼
zhaopian16
2011-07-20
呵呵,lz好,很不幸的我也遇到你类似的问题了,关键是我现在游标不能关掉,关掉需要一定的条件才可以,不知你的问题后来使用什么方法解决的,能大致介绍下吗,谢谢了!!!
2 楼
亚当爱上java
2011-05-06
changong 写道
我也遇到这个问题了,都是游标没关闭惹的祸。
英雄所见略同,呵呵。
1 楼
changong
2011-05-05
我也遇到这个问题了,都是游标没关闭惹的祸。
发表评论
-
深入理解Android的密度独立性
2013-06-17 10:24 1870前言 安卓是一个只 ... -
滑动操作的维度研究
2013-06-13 10:44 1179提示:这篇文章 ... -
移动开发高价值资料参考[持续更新中]
2013-06-13 09:56 1540做人要厚道转载请注明出处:http://zhangkun71 ... -
手机产品设计之用户引导
2013-06-10 20:21 1416在手机产品的设计过程中,由于手机界面 ... -
Android 设计的几处硬伤
2013-06-08 11:31 1578[核心提示] 一些 Andro ... -
Android开发大牛们的博客[持续更新中]
2013-05-31 08:40 27做人要厚道转载请注明出处:http://zhangk ... -
LocalActivityManager的内部机制详解
2013-05-27 15:56 5200LocalActivityManager的内部 ... -
App调试内存泄露之Cursor深入研究
2013-05-24 15:20 0最近在工作中处 ... -
Android设计模式系列(6)--SDK源码之享元模式
2013-05-24 13:12 924享元模式,给我的感 ... -
Android设计模式系列(5)--SDK源码之备忘录模式
2013-05-24 11:15 1083定义(源于GoF《设计模式》):在不破坏封闭的前提下,捕获 ... -
Android设计模式系列(4)--SDK源码之模板方法模式
2013-05-24 10:39 889模板方法,和单例模 ... -
Android设计模式系列(3)--SDK源码之单例模式
2013-05-24 09:43 1007单例模式,可以说是GOF的23种设计模式中最简单的一个。这 ... -
Android设计模式系列(2)--SDK源码之观察者模式
2013-05-23 17:41 1311观察者模式,是一种非常常见的设计模式,在很多系统中随处可见 ... -
Android设计模式系列(1)--SDK源码之组合模式
2013-05-23 17:12 879Android中对组合模式的应用,可谓是泛滥成粥,随处可见, ... -
Android设计模式系列(0)--开篇
2013-05-23 17:11 1203有时候,最难的是坚持;有时候缺少的是信念。 看了很多 ... -
Android Design与Holo Theme详解
2013-05-22 14:06 1545在 国内,有个很有意思的现状。一方面,几个国内最大的公司/企 ... -
GitHub上最火的Android开源项目(完结篇)
2013-05-22 09:22 7701摘要:截至目前,在GitHub“最受欢迎的开源项目”系列文 ... -
二十六个月Android学习工作总结
2013-05-21 16:52 2397本文转自http://www.cnblog ... -
Android中的Layout_weight终极研究
2013-05-17 14:08 3983以前在做UI布局时,也经常用Layout_weight属性 ... -
谷歌I/O大会给开发者带来福音:推出最新Android Studio开发工具
2013-05-17 08:59 1410摘要:在Android Studio发布之后,无论国内外, ...
相关推荐
1、写在开头 标题之前我想说一下Linux的mysql真的实在是太坑了。太坑了。总是会出现这样那样的你想不到的问题。崩溃了。首先来罗列一下我遇到过的...Cause:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorExcepti
Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException The last packet successfully received from the server was 47,795,922 milliseconds ago. The last packet sent successfully to the server was...
### MySQL 数据库在 Spring Boot 项目中启动报错问题解析 #### 错误信息解读 在给定的信息中,我们注意到一个具体的错误信息:“com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error:...
在使用Mybatis框架时,你可能会遇到`org.apache.ibatis.exceptions.PersistenceException`这样的异常。这个异常通常表示在执行数据库查询操作时遇到了问题。本篇将详细分析这个问题并提供解决方法。 ### 问题概述 ...
然而,在某些情况下,当你尝试使用`execjs`执行包含浏览器环境特定对象(如`document`或`window`)的JavaScript代码时,可能会遇到`execjs._exceptions.ProgramError`,比如`ReferenceError: document is not ...
23)..Fixed: NT service may not log all exceptions 24)..Fixed: SSL port number for Bugzilla 25)..Fixed: Disabling "Activate Exception Filters" option was ignored 26)..Fixed: Missing FTP proxy settings ...
然而,实际运行时,日志显示了一个错误消息:“Exceptions are not yet supported across processes.” 这意味着,尽管AIDL会生成代码来尝试序列化异常并将其传递给另一端,但在Android的Binder机制中,异常并不能...
Chapter 15: Errors and Exceptions . . . . . . . . . . . . . . . . . . . . . . . . .351 Part ii: Visual Studio Chapter 16: Visual Studio 2010 . . . . . . . . . . . . . . . . . . . . . . . . . .373 ...
Chapter 15: Errors and Exceptions . . . . . . . . . . . . . . . . . . . . . . . . .351 Part ii: Visual Studio Chapter 16: Visual Studio 2010 . . . . . . . . . . . . . . . . . . . . . . . . . .373 ...
"JavaSE程序设计课件:L05-Exceptions and Assertions - 1.pdf"主要涵盖了两个核心主题:异常(Exceptions)和断言(Assertions)。 1. 异常(Exceptions) 异常是程序执行过程中发生的非正常事件,可以分为三种...
常见问题及解决: (一)启动eclipse,打开Window->Preferences->Java->JadClipse,如果没有找到JadClipse,即JadClipse插件没有激活。 (1)检查插件安装的版本是否与你安装的eclipse版本对应 (2)使用 –...
SP-6836 : Parentheses are not consistent in nested queries. SP-6854 : Extra lines no longer added between procedure call with text as parameter and a comment. SP-6882 : Fix delays in core mechanism of...
### MySQL异常...通过适当调整MySQL服务器的`wait_timeout`配置或C3P0连接池的相关参数,可以有效地解决此类问题。在实际操作过程中,还需要根据具体的业务场景选择合适的配置方案,以达到最佳的效果。
《MobZ:一款基于Java的香草风格怪物模组》 MobZ,作为一个深受玩家喜爱的Minecraft模组,以其独特的香草风格和丰富的游戏体验,吸引了大量的MC爱好者。这款模组专注于增加新的怪物种类,旨在拓展游戏的生物多样性...
redis.exceptions.ConnectionError: Error 10061 connecting to 127.0.0.1:6379. 由于目标计算机积极拒绝,无法连接。安装这个包即可,给的github链接地址给下载奇慢
Rhino_Python_Primer.pdf Forums: The RhinoPython community is very active ...http://docs.python.org/release/3.1.3/library/exceptions.html#bltin-exceptions http://secant.cs.purdue.edu/_media/proghints.pdf
资源分类:Python库 所属语言:Python 资源全名:better_exceptions-0.2.3.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059