`
亚当爱上java
  • 浏览: 706134 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

解决android项目系统崩溃:Exceptions are not yet supported across processes.

阅读更多
目前在开发一个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{}代码块中关闭的,没问题。问题究竟出在哪里,后来通过仔细查看代码,原来我在查询联系人时用了两层游标,我只关闭了外层游标,没有关闭里层的,导致内存资源没有被释放。多次运行后,系统资源被耗尽。
分享到:
评论
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  
我也遇到这个问题了,都是游标没关闭惹的祸。

相关推荐

    Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: ….. this is incompatible with sq

    1、写在开头 标题之前我想说一下Linux的mysql真的实在是太坑了。太坑了。总是会出现这样那样的你想不到的问题。崩溃了。首先来罗列一下我遇到过的...Cause:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorExcepti

    解决Cause com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

    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数据库在springboot项目中启动报错问题.docx

    ### MySQL 数据库在 Spring Boot 项目中启动报错问题解析 #### 错误信息解读 在给定的信息中,我们注意到一个具体的错误信息:“com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error:...

    Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法

    在使用Mybatis框架时,你可能会遇到`org.apache.ibatis.exceptions.PersistenceException`这样的异常。这个异常通常表示在执行数据库查询操作时遇到了问题。本篇将详细分析这个问题并提供解决方法。 ### 问题概述 ...

    Python 解决execjs._exceptions.ProgramError: ReferenceError: document is not defined报错问题

    然而,在某些情况下,当你尝试使用`execjs`执行包含浏览器环境特定对象(如`document`或`window`)的JavaScript代码时,可能会遇到`execjs._exceptions.ProgramError`,比如`ReferenceError: document is not ...

    EurekaLog_7.5.0.0_Enterprise

    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 ...

    Android跨进程抛异常的原理的实现

    然而,实际运行时,日志显示了一个错误消息:“Exceptions are not yet supported across processes.” 这意味着,尽管AIDL会生成代码来尝试序列化异常并将其传递给另一端,但在Android的Binder机制中,异常并不能...

    Professional C#4.0 and .NET 4.0 part2

    Chapter 15: Errors and Exceptions . . . . . . . . . . . . . . . . . . . . . . . . .351 Part ii: Visual Studio Chapter 16: Visual Studio 2010 . . . . . . . . . . . . . . . . . . . . . . . . . .373 ...

    Professional C# 4.0 and .NET 4.0 part1

    Chapter 15: Errors and Exceptions . . . . . . . . . . . . . . . . . . . . . . . . .351 Part ii: Visual Studio Chapter 16: Visual Studio 2010 . . . . . . . . . . . . . . . . . . . . . . . . . .373 ...

    JavaSE程序设计课件:L05-Exceptions and Assertions - 1.pdf

    "JavaSE程序设计课件:L05-Exceptions and Assertions - 1.pdf"主要涵盖了两个核心主题:异常(Exceptions)和断言(Assertions)。 1. 异常(Exceptions) 异常是程序执行过程中发生的非正常事件,可以分为三种...

    Java反编译Jad大全:jad.1.5.8+net.sf.jadclipse_3.3.0+配置方法

    常见问题及解决: (一)启动eclipse,打开Window-&gt;Preferences-&gt;Java-&gt;JadClipse,如果没有找到JadClipse,即JadClipse插件没有激活。 (1)检查插件安装的版本是否与你安装的eclipse版本对应 (2)使用 –...

    SQL Prompt_9.1.8.4871破解版

    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 异常com.mysql.jdbc.CommunicationsException

    ### MySQL异常...通过适当调整MySQL服务器的`wait_timeout`配置或C3P0连接池的相关参数,可以有效地解决此类问题。在实际操作过程中,还需要根据具体的业务场景选择合适的配置方案,以达到最佳的效果。

    MobZ:https://www.curseforge.comminecraftmc-modsmobz

    《MobZ:一款基于Java的香草风格怪物模组》 MobZ,作为一个深受玩家喜爱的Minecraft模组,以其独特的香草风格和丰富的游戏体验,吸引了大量的MC爱好者。这款模组专注于增加新的怪物种类,旨在拓展游戏的生物多样性...

    Redis-x64-3.0.503_bak.zip

    redis.exceptions.ConnectionError: Error 10061 connecting to 127.0.0.1:6379. 由于目标计算机积极拒绝,无法连接。安装这个包即可,给的github链接地址给下载奇慢

    Rhino5_Python_Primer.pdf

    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库 | better_exceptions-0.2.3.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:better_exceptions-0.2.3.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

Global site tag (gtag.js) - Google Analytics